-
Notifications
You must be signed in to change notification settings - Fork 160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MobileNetV2.onnx转换过程报错 #990
Comments
解决方案:从TF转ONNX的时候,将opset设置为<13。
原因:Squeeze-13的axis参数类型为tensor(int64),Squeeze-11的axis参数类型为list of ints。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
问题描述
网络为来自tensorflow官方的预训练的MobileNetV2,首先将tensorflow模型转换为onnx,使用x2paddle将onnx转换为paddle时,发生以下错误:
具体信息
MobileNetV2:
然后将tensorflow转换为onnx:
PaddlePaddle => :2.5.1:
X2Paddle => :1.4.1:
来源框架版本(PyTorch/TF/ONNX/Caffe) => :tf2onnx: 1.15.0,onnx: 1.13.1,tensorflow: 2.13.0
我的尝试
经过简单调试发现在
get_default_args
函数中进行判断时,打印axis的信息,可以看到attrs[default_k]是一个列表,即[2 3],但是使用数据类型判断是否为list时,结果为False,造成了条件判断错误,使用Netron观察网络,也可以看到在Squeeze算子的地方,出现了[2, 3]的参数The text was updated successfully, but these errors were encountered: