当前位置:网站首页>转换为onnx模型错误汇总
转换为onnx模型错误汇总
2022-08-09 07:50:00 【HySmiley】
1、ValueError: torch.nn.DataParallel is not supported by ONNX exporter, please use 'attribute' module to unwrap model from torch.nn.DataParallel. Try torch.onnx.export(model.module, ...)
多GPU环境下训练的模型在导出onnx文件时,可能会报以上错误。
是因为加载模型前加了此句,model = nn.DataParallel(model)
如果不加,依然报错,如图看到参数字典多了一个module.
可以遍历模型删除各参数部分中出现的
边栏推荐
- yolov5检测数据集标签数量
- 【Template】Tree Chain Segmentation P3384
- SAP ALV data export many of the bugs
- SAP ALV 数据导出被截断的bug
- Four departments including the Ministry of Industry and Information Technology promote green smart home products to the countryside
- The String class objects created by the JVM memory allocation and the difference between equals and = =
- One-click login server script
- 软件测试的岗位会越来越少吗?
- redis学习笔记
- 【Rust指南】快速入门|开发环境|hello world
猜你喜欢
随机推荐
C language: detailed explanation of soda bottle
74HC595 chip pin description
我的创作纪念日
C#基础学习
Apache POI
js数组相关知识复习
Lottie系列四:使用建议
HDU - 3183 A Magic Lamp 线段树
LeetCode: 876. The middle node of the linked list —— simple
Win10桌面图标排列混乱
redis学习笔记
Use tensorflow.keras to build a neural network model modularly
BGP路由协议的那些事?(中)
resourcemanager启动失败,别的节点成功
Unity first lesson
Tkinter可以选择的颜色
种子数据报错:liquibase.exception.ValidationFailedException: Validation Failed
tianqf的解题思路
毕业我选择了保家卫国,退伍我选择了华为外包
类和结构体