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

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

本站已经建立2718天!

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