While converting YOLO onnx model, I get the following error. Any ideas as to what could be the cause of this?
Parsing model
While parsing node number 463 [Reshape -> "830"]:
ERROR: /home/shashank/onnx-tensorrt/builtin_op_importers.cpp:900 In function importReshape:
[8] Assertion failed: new_shape.nbDims == 3
What's the output shape of the reshape node?
Here are all the operations on shapes:
(N, 75, 13, 13) is reshaped to (N, 75, 13x13)
(N, 75, 13x13) is transposed to (N, 13x13, 75)
(N, 13x13, 75) is reshaped to (N, 13x13x3, 25)
Yes, right now, we only support reshape to 2D or 4D tensors including the batch size: https://github.com/onnx/onnx-tensorrt/blob/e7be19cff377a95817503e8525e20de34cdc574a/builtin_op_importers.cpp#L893-L907
This might be something we can improve...
Yes unfortunately this is not currently supported. However, an upcoming update will add support for it using TensorRT 4.
I also figured that. I was wondering if you had something to circumvent this problem for now.
When is the update expected to be released?
I found a makeshift solution to reshape by adding an extra dimension. This fixed the previous error. However, now I run into the following error -
[2018-06-12 18:43:45 ERROR] runtime.cpp (16) - Cuda Error in allocate: 2
[2018-06-12 18:43:45 ERROR] runtime.cpp (16) - Cuda Error in allocate: 2
terminate called after throwing an instance of 'std::runtime_error'
what(): Failed to create object
Aborted (core dumped)
It doesn't look like OOM error. I would appreciate any cue on what caused this.
UPDATE: turns out it is OOM error. Using reduced image size fixes it.
@shashanktyagi https://github.com/onnx/onnx-tensorrt/pull/21 is in merged. See if that unblocks you?
Hi, I meet a seem problem. my matrix is (18,512), but when i reshape it to (2,9,512), it will report the following question.when i reshape to (2,9,1,512),it's still wrong.so can you give me some advice.

Hi,
I think my issue is similar to @shashanktyagi 's initial problem. I am converting S3FD model to tensorRT.
Input filename: s3fd_1280_sq.onnx
ONNX IR version: 0.0.3
Opset version: 6
Producer name: pytorch
Producer version: 0.3
Domain:
Model version: 0
Doc string:
----------------------------------------------------------------
Parsing model
While parsing node number 51 [Reshape -> "117"]:
ERROR: /home/**/onnx-tensorrt/builtin_op_importers.cpp:1383 In function importReshape:
[8] Assertion failed: get_shape_size(new_shape) == get_shape_size(weights.shape)
here is the verbose output
Are any of you in this thread still having issues? Have you tried parsing your models with the latest TensorRT release (7.2)?
Closing due to inactivity - if you are still having issues with the latest version of onnx-tensorrt feel free to open a new issue.
Most helpful comment
Hi, I meet a seem problem. my matrix is (18,512), but when i reshape it to (2,9,512), it will report the following question.when i reshape to (2,9,1,512),it's still wrong.so can you give me some advice.