-
-
Notifications
You must be signed in to change notification settings - Fork 56.5k
Error (-215:Assertion failed) blob.type() == 5 in function 'populateNet' #16718
Description
System information
- OpenCV => 4.2.0-dev
- Operating System / Platform => Ubuntu 18.04
- Python => 3.6.6
- PyTorch = 1.1
Detailed description
I trained mobilenet_v2 and added SSD in FastAI on a custom dataset, then exported to ONNX using the following:
torch.save(learn.model.state_dict(),'mobilenet_v2_ssd.pt')
Here's the code I use to convert the model:
learn_eval = learn.model.eval() dummy_input = torch.randn(1, 3, 480, 480).cuda() torch_out = torch.onnx_export(learn_eval, dummy_input, model_path+"mobilenet_v2_ssd.onnx", export_params=True)
Steps to reproduce:
- Model
- readnetfromONNX("mobilenet_v2_ssd.onnx")
Here's the Traceback:
Traceback (most recent call last):
File "predict_from_onnx.py", line 28, in
net = cv2.dnn.readNetFromONNX("mobilenet_v2_ssd.onnx")
cv2.error: OpenCV(4.2.0-dev)
.../onnx_importer.cpp:555: error: (-215:Assertion failed) blob.type() == 5 in function 'populateNet'
I'm thinking there are some operations in the model that aren't supported by cv2.dnn but I'm not sure where to start looking, any help is greatly appreciated!