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

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

本站已经建立2583天!

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