Closed niuxiaozhang closed 3 years ago
While parsing node number 26 [Transpose -> "96"]: ERROR: /home/erisuser/p4sw/sw/gpgpu/MachineLearning/DIT/release/5.0/parsers/onnxOpenSource/builtin_op_importers.cpp:1660 In function importTranspose: [8] Assertion failed: perm.order[BATCH_DIM] == BATCH_DIM ERROR: failed to parse onnx file
this may be caused by transpose batch dimension
老哥问题解决了吗
Have you solved it?
@niuxiaozhang @persuelx @zhenming33 I meet the same problem ,how did you solve it?
@feitiandemiaomi sorry, I have not solverd it
@feitiandemiaomi @persuelx in my case, i change shape from batch_size channel w to w batch_size channel, don't transpose batch_size dimension in model
@zhenming33 你是对的,我看了源码,tensorrt确实不允许batch_size的维度发生变化,像我的代码out = out.permute(3, 0, 1, 2).view(out.size(3), out.size(0), -1) 改成out = out.permute(0, 3, 2, 1).view(out.size(3), out.size(0), -1) 即可以解决上述报错
@persuelx 可以借鉴
@feitiandemiaomi @zhenming33 thank u ,I have done it successfully
@persuelx can you paste the error code ,because I find the new problem.
My mistake is the same as the first floor(niuxiaozhang),your mistake is not the same as mine。
@persuelx Does your code contain view or reshape , I want to verify my error
en
def forward(self, x): out = self.features(x) out = self.avgpool(out) out = out.permute(3, 0, 1, 2).view(out.size(3), out.size(0), -1) out = self.classifier(out) out = F.log_softmax(out, dim=2) return out Here are all the operations on shapes: [1, 3, 32, 200] ->[1, 384, 4, 25] ->[1, 384, 1, 25] ->[25, 1, 384] ->[25, 1, 5990]
@persuelx I can determine thar the error is view op. can you share forward code?
Has anyone tried to repro this with later versions of TensorRT?
Closing due to inactivity - if this can be reproduced on the latest version of onnx-tensorrt feel free to open a new issue.