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

本站现有博文321篇,共被浏览764932

本站已经建立2443天!

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