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

本站现有博文332篇,共被浏览892862

本站已经建立2594天!

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