-
Notifications
You must be signed in to change notification settings - Fork 46
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
simplify_onnx(onnx_path) report errors #28
Comments
Can you try to run onnx simplifier in cli manually rather than run main.py? |
of course,I use the following command in cli to generate a new onnx model. How can I serialize and save this model for C + + reasoning?
I don't know how to use the new onnx model。 Thank you for your reply。 |
the outputmodel.onnx is equivalent to the output in https://github.com/TrojanXu/yolov5-tensorrt/blob/master/main.py#L368. so just feed it into the next step after line 368. |
When I annotate # simplify_onnx(onnx_path) and set onnx_path = "outputmodel.onnx" New errors will be received
I found that I couldn't parse the onnx model, but I could use netron to open the onnx model。
|
ERROR: Failed to parse the ONNX file. In node -1 (parseGraph): UNSUPPORTED_NODE: Assertion failed: convertOnnxWeights(initializer, &weights, ctx) |
Hello, I am experiencing the exact same error. I am using the correct versions (torch 1.4, onnx 1.6, trt 7).
any ideas? Thanks! Edit: Do I have to retrain with your new config with custom Upsample? Is this the Node that fails to parse? Greetings, |
Hello again, even after retraining from scratch with the custom Upsample, the same error occurs. Thanks |
@mfruhner Facing the same issue. Were you able to make any progress on this one? |
Facing the same issue. Were you able to make any progress on this one? |
Have you solved this problem? Now I have the same problem. How did you solve it?THks! |
(I tried with the yolov5s.pt in this repo) Facing the same issue. What should I do😥 |
New version updated, tracking yolov5 v3.0 release. |
yolov5-3.0 used 》》》》》》ERROR: Failed to parse the ONNX file. In node -1 (parseGraph): UNSUPPORTED_NODE: Assertion failed: convertOnnxWeights(initializer, &weights, ctx) |
python main.py:
`
%960 : Float(1, 3, 80, 64, 81) = onnx::Slice(%918, %957, %958, %956, %959) # /home/zxzn/yolov5-tensorrt/yolo.py:42:0
%961 : Float(1, 3, 80, 64, 81) = onnx::Castto=1 # /home/zxzn/yolov5-tensorrt/yolo.py:42:0
%962 : Long() = onnx::Constantvalue={-1}
%963 : Long() = onnx::Constantvalue={81}
%964 : Tensor = onnx::Unsqueezeaxes=[0]
%965 : Tensor = onnx::Unsqueezeaxes=[0]
%966 : Tensor = onnx::Unsqueezeaxes=[0]
%967 : Tensor = onnx::Concat[axis=0](%964, %965, %966)
%968 : Float(1, 15360, 81) = onnx::Reshape(%961, %967) # /home/zxzn/yolov5-tensorrt/yolo.py:42:0
%969 : Float(1, 15360, 85) = onnx::Concat[axis=-1](%955, %968) # /home/zxzn/yolov5-tensorrt/yolo.py:44:0
%prediction : Float(1, 20160, 85) = onnx::Concat[axis=1](%751, %860, %969) # /home/zxzn/yolov5-tensorrt/yolo.py:46:0
return (%prediction)
段错误 (核心已转储)
`
i use :
python -m onnxsim yolov5_1.onnx outputmodel.onnx
Simplifying... Checking 0/3... Checking 1/3... Checking 2/3... Ok!
A new onnx model will be generated. What should I do next
Change the name of the new onnx model to yolov5_ 1. Onnx, and then log off the following code?
# export_onnx(model, batch_size) # simplify_onnx(onnx_path)
A new error will be reported after running
ERROR: Failed to parse the ONNX file. In node -1 (parseGraph): UNSUPPORTED_NODE: Assertion failed: convertOnnxWeights(initializer, &weights, ctx)
What should I do? Thank you for your help
This is my environment:
Package Version
appdirs 1.4.4
certifi 2020.6.20
cycler 0.10.0
decorator 4.4.2
graphsurgeon 0.4.1
kiwisolver 1.2.0
Mako 1.1.3
MarkupSafe 1.1.1
matplotlib 3.3.0
numpy 1.19.0
onnx 1.6.0
onnx-simplifier 0.2.9
onnxruntime 1.4.0
opencv-python 4.3.0.36
Pillow 7.2.0
pip 20.1.1
protobuf 3.12.2
pycuda 2019.1.2
pyparsing 2.4.7
python-dateutil 2.8.1
pytools 2020.3.1
PyYAML 5.3.1
scipy 1.5.1
setuptools 49.2.0.post20200714
six 1.15.0
tensorrt 7.0.0.11
torch 1.4.0
torchvision 0.5.0
tqdm 4.48.0
typing-extensions 3.7.4.2
uff 0.6.5
wheel 0.34.2
The text was updated successfully, but these errors were encountered: