yolor
yolor copied to clipboard
error while converting to onnx
I'm trying to convert yolor_p6.pt to onnx and when i run the export file i get this error :
model = torch.load(opt.weights, map_location=torch.device('cpu'))['model'].float() AttributeError: 'collections.OrderedDict' object has no attribute 'float'
The same problem also arises when I run the code. After modifications (removing the float) it seems to run smoothly until it reaches a point with the following error message:
ONNX export failure: Exporting the operator Silu to ONNX "opset" version 12 is not supported. Please open a bug to request ONNX export support for the missing operator.
Has anybody encountered this issue and knows a way out? Just be be clear, also higher "opset" versions have been tried (up to 15) and the error still remains the same.
I found that I needed to download the .pt file using the link provided in scripts/get_pretrain.sh
Note the difference between the filenames where the link in the repo is yolor_p6.pt
versus yolor-p6.pt
. The latter did not have this attribute error AttributeError: 'collections.OrderedDict' object has no attribute 'float'
.
I too am stuck at the issue with Silu. This issue is not discussed in the other issues relating to onnx conversion.
I found that I needed to download the .pt file using the link provided in
scripts/get_pretrain.sh
Note the difference between the filenames where the link in the repo isyolor_p6.pt
versusyolor-p6.pt
. The latter did not have this attribute errorAttributeError: 'collections.OrderedDict' object has no attribute 'float'
. I too am stuck at the issue with Silu. This issue is not discussed in the other issues relating to onnx conversion. I solved it by update torch to version 1.8.x