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

本站现有博文333篇,共被浏览923199

本站已经建立2629天!

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