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

本站现有博文340篇,共被浏览1020076次

本站已经建立2719天!

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