1 Star 0 Fork 0

tom/pytorch_to_tflite

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
torch_to_onnx.py 411 Bytes
一键复制 编辑 原始数据 按行查看 历史
kwakhyunmin 提交于 3年前 . first
import torch
from torchvision.models import mobilenet_v2
img_size = (640, 640)
batch_size = 1
onnx_model_path = 'model.onnx'
model = mobilenet_v2()
model.eval()
sample_input = torch.rand((batch_size, 3, *img_size))
y = model(sample_input)
torch.onnx.export(
model,
sample_input,
onnx_model_path,
verbose=False,
input_names=['input'],
output_names=['output'],
opset_version=12
)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/tom_ud/pytorch_to_tflite.git
git@gitee.com:tom_ud/pytorch_to_tflite.git
tom_ud
pytorch_to_tflite
pytorch_to_tflite
main

搜索帮助