Giter Site home page Giter Site logo

Comments (3)

Channingss avatar Channingss commented on August 21, 2024

有尝试过转换未经过onnx-simplifier-master的模型吗?

from x2paddle.

luoduo21 avatar luoduo21 commented on August 21, 2024

用onnx=1.6.0一直提示 onnx==1.5.0 is required
所以环境用的pytorch1.3,onnx=1.5.0,onnxruntime=1.0.0,使用未经过onnx-simplifier-master转换的SSD模型,错误如下:
(pytorch1.3) zt@zt:~/androidprojects/X2Paddle-develop$ x2paddle --framework=onnx --model=test.onnx --save_dir=pd_model
Now translating model from onnx to paddle.
model ir_version: 4, op version: 9
onnxruntime==0.4.0 is required
Total nodes: 206
in (Constant -> _107): attribute "shape" of _107 not inferred, using value as 1-D tensor may lead to fails
in (Constant -> _111): attribute "shape" of _111 not inferred, using value as 1-D tensor may lead to fails
in (Constant -> _160): attribute "shape" of _160 not inferred, using value as 1-D tensor may lead to fails
in (Constant -> _163): attribute "shape" of _163 not inferred, using value as 1-D tensor may lead to fails
in (Constant -> _168): attribute "shape" of _168 not inferred, using value as 1-D tensor may lead to fails
in (Constant -> _171): attribute "shape" of _171 not inferred, using value as 1-D tensor may lead to fails
in (Constant -> _176): attribute "shape" of _176 not inferred, using value as 1-D tensor may lead to fails
in (Constant -> _179): attribute "shape" of _179 not inferred, using value as 1-D tensor may lead to fails
in (Constant -> _184): attribute "shape" of _184 not inferred, using value as 1-D tensor may lead to fails
in (Constant -> _187): attribute "shape" of _187 not inferred, using value as 1-D tensor may lead to fails
in (Constant -> _192): attribute "shape" of _192 not inferred, using value as 1-D tensor may lead to fails
in (Constant -> _195): attribute "shape" of _195 not inferred, using value as 1-D tensor may lead to fails
in (Constant -> _200): attribute "shape" of _200 not inferred, using value as 1-D tensor may lead to fails
in (Constant -> _203): attribute "shape" of _203 not inferred, using value as 1-D tensor may lead to fails
in (Constant -> _209): attribute "shape" of _209 not inferred, using value as 1-D tensor may lead to fails
in (Constant -> _212): attribute "shape" of _212 not inferred, using value as 1-D tensor may lead to fails
in (Constant -> _217): attribute "shape" of _217 not inferred, using value as 1-D tensor may lead to fails
in (Constant -> _220): attribute "shape" of _220 not inferred, using value as 1-D tensor may lead to fails
in (Constant -> _225): attribute "shape" of _225 not inferred, using value as 1-D tensor may lead to fails
in (Constant -> _228): attribute "shape" of _228 not inferred, using value as 1-D tensor may lead to fails
in (Constant -> _233): attribute "shape" of _233 not inferred, using value as 1-D tensor may lead to fails
in (Constant -> _236): attribute "shape" of _236 not inferred, using value as 1-D tensor may lead to fails
in (Constant -> _241): attribute "shape" of _241 not inferred, using value as 1-D tensor may lead to fails
in (Constant -> _244): attribute "shape" of _244 not inferred, using value as 1-D tensor may lead to fails
in (Constant -> _249): attribute "shape" of _249 not inferred, using value as 1-D tensor may lead to fails
in (Constant -> _252): attribute "shape" of _252 not inferred, using value as 1-D tensor may lead to fails
in (Constant -> _258): attribute "shape" of _258 not inferred, using value as 1-D tensor may lead to fails
in (Constant -> _261): attribute "shape" of _261 not inferred, using value as 1-D tensor may lead to fails
in (Constant -> _262): attribute "shape" of _262 not inferred, using value as 1-D tensor may lead to fails
in (Constant -> _268): attribute "shape" of _268 not inferred, using value as 1-D tensor may lead to fails
in (Constant -> _271): attribute "shape" of _271 not inferred, using value as 1-D tensor may lead to fails
in (Constant -> _272): attribute "shape" of _272 not inferred, using value as 1-D tensor may lead to fails
Traceback (most recent call last):
File "/home/zt/tools/anaconda3/envs/pytorch1.1/bin/x2paddle", line 11, in
load_entry_point('x2paddle==0.6.0', 'console_scripts', 'x2paddle')()
File "/home/zt/androidprojects/X2Paddle-develop/x2paddle/convert.py", line 233, in main
onnx2paddle(args.model, args.save_dir, params_merge)
File "/home/zt/androidprojects/X2Paddle-develop/x2paddle/convert.py", line 170, in onnx2paddle
mapper = ONNXOpMapper(model, save_dir)
File "/home/zt/androidprojects/X2Paddle-develop/x2paddle/op_mapper/onnx_op_mapper.py", line 90, in init
func(node)
File "/home/zt/androidprojects/X2Paddle-develop/x2paddle/op_mapper/onnx_op_mapper.py", line 513, in Unsqueeze
if len(val_x.out_shapes[0]) == 0:
TypeError: object of type 'NoneType' has no len()

并且torchvision里的model大部分转换都失败,只有直接使用提供的shuffleNet onnx能转换成功.

x2paddle --framework=onnx --model=resnet18.onnx --save_dir=pd_model
Now translating model from onnx to paddle.
model ir_version: 4, op version: 9
onnxruntime==0.4.0 is required
Total nodes: 69
Traceback (most recent call last):
File "/home/zt/tools/anaconda3/envs/pytorch1.1/bin/x2paddle", line 11, in
load_entry_point('x2paddle==0.6.0', 'console_scripts', 'x2paddle')()
File "/home/zt/androidprojects/X2Paddle-develop/x2paddle/convert.py", line 233, in main
onnx2paddle(args.model, args.save_dir, params_merge)
File "/home/zt/androidprojects/X2Paddle-develop/x2paddle/convert.py", line 170, in onnx2paddle
mapper = ONNXOpMapper(model, save_dir)
File "/home/zt/androidprojects/X2Paddle-develop/x2paddle/op_mapper/onnx_op_mapper.py", line 96, in init
self.elementwise_map(node)
File "/home/zt/androidprojects/X2Paddle-develop/x2paddle/op_mapper/onnx_op_mapper.py", line 277, in elementwise_map
if len(val_x_shape) < len(val_y_shape):
TypeError: object of type 'NoneType' has no len()

from x2paddle.

luoduo21 avatar luoduo21 commented on August 21, 2024

已解决x2paddle更新到0.7.0就没问题了

from x2paddle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.