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
标签云
Knowledge MD5 Hilton LoRA Bert Nginx Statistics Gemma HuggingFace 继承 Distillation UI ModelScope 音频 Bin CTC FP32 Pytorch Animate NameSilo Pickle mmap Proxy 版权 Input Windows tar CV Algorithm Qwen2.5 Ubuntu printf LaTeX Dataset tqdm Base64 SQLite 腾讯云 SVR VSCode CAM CSV GGML Heatmap OpenAI CEIR Attention EXCEL Tensor VPN Data VGG-16 Review Hotel Github Python WAN GPTQ YOLO SAM logger git-lfs Quantize GIT 报税 Augmentation Safetensors TensorFlow Plate Anaconda Password LLM Bipartite scipy 多线程 NLP v0.dev Pandas LeetCode Tracking PIP Web GoogLeNet Jetson DeepSeek BeautifulSoup git XML FlashAttention Conda Diagram Shortcut 证件照 uwsgi Magnet Markdown OpenCV SPIE InvalidArgumentError Freesound Permission Transformers IndexTTS2 OCR Tiktoken Template API Pillow 飞书 LLAMA BTC Git Docker BF16 Plotly ONNX FP64 DeepStream 算法题 Streamlit Domain Google FP8 Excel Logo NLTK Video 域名 Ptyhon diffusers RGB Quantization FastAPI Website SQL Llama 多进程 TSV PyCharm Card 公式 Color 签证 Qwen 财报 PDF COCO PyTorch Breakpoint Bitcoin WebCrawler Vim Numpy Jupyter PDB Claude v2ray Image2Text Michelin Clash ChatGPT Disk Land Firewall CC Crawler UNIX JSON Random XGBoost Miniforge RAR AI Vmess Paper 搞笑 ResNet-50 Qwen2 HaggingFace Linux Paddle 阿里云 uWSGI CUDA Datetime Interview Hungarian Math Zip 净利润 llama.cpp Food TTS Translation Baidu 关于博主 hf FP16 torchinfo QWEN Django CLAP Sklearn Use transformers Cloudreve C++ Mixtral GPT4 TensorRT
站点统计

本站现有博文309篇,共被浏览735798

本站已经建立2373天!

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