EADST

ONNX Inference with ONNX Runtime

ONNX Inference with ONNX Runtime

import torch
import onnxruntime
import numpy as np

# tensor input to numpy
# input_data=tensor.numpy()
# numpy input
input_data = np.load("test_data.npy")
session = onnxruntime.InferenceSession("model_name.onnx")
ort_inputs = {session.get_inputs()[0].name: input_data}
ort_outs = session.run(None, ort_inputs)
# tensor output
# out = torch.Tensor(ort_outs).cpu()
np.save("output.npy", ort_outs)
print("save output.npy done")
相关标签
About Me
XD
Goals determine what you are going to be.
Category
标签云
ONNX FP32 torchinfo ResNet-50 FP64 Linux Numpy API CEIR Plate v2ray Diagram Website Django Animate Transformers mmap Python TTS UNIX Baidu Sklearn tqdm Crawler 算法题 递归学习法 Dataset SQLite RGB MD5 Hungarian DeepSeek Hotel Github Land PyCharm FP16 Math uwsgi Qwen LLM OCR Gemma Use 域名 JSON LaTeX Windows Datetime XGBoost VPN GIT 强化学习 Translation Tensor TensorFlow OpenAI Pillow Quantization Bin Vmess PyTorch Ptyhon Ubuntu 签证 Algorithm v0.dev Paper PIP SAM Cloudreve Food Template Permission GPTQ 图形思考法 Magnet Review Miniforge COCO PDF CLAP WAN HaggingFace Augmentation Heatmap BTC Interview LeetCode Data 阿里云 Nginx Quantize PDB Agent tar Pytorch AI 版权 logger Pandas LoRA icon 报税 多进程 GoogLeNet 云服务器 InvalidArgumentError Conda Vim YOLO ModelScope EXCEL Git transformers Search FastAPI Logo Qwen2.5 Domain Google Zip GGML DeepStream Attention Markdown Random SVR NameSilo Mixtral diffusers TensorRT 飞书 UI Firewall hf QWEN CSV Paddle Disk CC IndexTTS2 Breakpoint Streamlit Plotly Clash Password Shortcut VSCode printf LLAMA Safetensors 搞笑 VGG-16 Knowledge Tiktoken Color Web Claude Rebuttal 腾讯云 BF16 SPIE WebCrawler CV Bitcoin News Excel 净利润 CTC GPT4 RAR 音频 Bipartite uWSGI Jetson CAM llama.cpp Distillation 第一性原理 多线程 Llama Jupyter Hilton git-lfs XML NLTK Michelin 继承 NLP git Statistics C++ BeautifulSoup FlashAttention CUDA Image2Text 图标 Freesound Pickle FP8 Proxy 顶会 Qwen2 Bert SQL Tracking ChatGPT 关于博主 证件照 公式 HuggingFace scipy Video Anaconda OpenCV Input 财报 TSV Docker Card Base64
站点统计

本站现有博文323篇,共被浏览795347

本站已经建立2493天!

热门文章
文章归档
回到顶部