You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After training, I got the weights .h5. Next, I need to convert weights into ONNX model with dynamic batch_size.
Code for converting weights .h5 in ONNX-the model I took from here: keras2onnx
And then I want to convert ONNX-model to TensorRT Engine using trtexec. I have an ONNX model, but further conversion to TensorRT Engine does not work.
When I run the command: trtexec --onnx=retinanet-bbox.onnx --saveEngine=retinaNet.trt --minShapes=images:1x512x512x3 --optShapes=images:6x512x512x3 --maxShapes=images:12x512x512x3 --useCudaGraph --memPoolSize=workspace:3000 --noTF32 --fp16
I get an error: Error[2]: [myelinBuilderUtils.cpp::getMyelinSupportType::1270] Error Code 2: Internal Error (ForeignNode does not support data-dependent shape for now.)
My ONNX-model is correct. I checked it with code: check_onnx_model.py
Maybe I'm creating the ONNX model incorrectly...
I can't understand why this is happening? Could you help me solve this problem?
P.S. An Internet search did not provide answers to this problem.
I have attached my ONNX model in the attachment below.
Environment
TensorRT Version: 8.6 GPU Type: RTX3060 Nvidia Driver Version: nvidia-driver-535 (proprietary) CUDA Version: 11.1 CUDNN Version: 8.0.4 Operating System + Version: Ubuntu 20.04 Python Version (if applicable): 3.8 TensorFlow Version (if applicable): 2.4.0
Description
Hello!
My task is to train RetinaNet (backbone: resnet50, keras).
RetinaNet:
https://github.com/fizyr/keras-retinanet
After training, I got the weights .h5. Next, I need to convert weights into ONNX model with dynamic batch_size.
Code for converting weights .h5 in ONNX-the model I took from here: keras2onnx
![006a3f39c6873a5276f82d15d8dacf371c97c3c9](https://private-user-images.githubusercontent.com/65890558/273566695-2e564215-03e1-47ac-8a5c-b1c5e7508880.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQyOTczMDEsIm5iZiI6MTcyNDI5NzAwMSwicGF0aCI6Ii82NTg5MDU1OC8yNzM1NjY2OTUtMmU1NjQyMTUtMDNlMS00N2FjLThhNWMtYjFjNWU3NTA4ODgwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODIyVDAzMjMyMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWRmNTg1OWZhYTkzZTUwZjdkNGZjYTZkZmQ1NDI4Mzc3MDNmNWZiMGI2NjA1YmNlNjY1NWE5NGU2YThjMzVmZjAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.ujc01tgLYLviSkX-eT8mwqaVo6AIkMcgDsMBIyAdXCQ)
And then I want to convert ONNX-model to TensorRT Engine using trtexec. I have an ONNX model, but further conversion to TensorRT Engine does not work.
When I run the command:
trtexec --onnx=retinanet-bbox.onnx --saveEngine=retinaNet.trt --minShapes=images:1x512x512x3 --optShapes=images:6x512x512x3 --maxShapes=images:12x512x512x3 --useCudaGraph --memPoolSize=workspace:3000 --noTF32 --fp16
I get an error:
![17d90b314f521a701394a847733ef4578fbf3d16](https://private-user-images.githubusercontent.com/65890558/273566831-a9a52c30-3cbb-4f2a-922e-271fbc1f3942.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQyOTczMDEsIm5iZiI6MTcyNDI5NzAwMSwicGF0aCI6Ii82NTg5MDU1OC8yNzM1NjY4MzEtYTlhNTJjMzAtM2NiYi00ZjJhLTkyMmUtMjcxZmJjMWYzOTQyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODIyVDAzMjMyMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTc0N2IxMTcyYmY0MTljOGRiNzBkY2Q4ZThhZTJlNTc4ZGY0MjBhMDQ3ZTJkYWJhMjMzZjM4OWRjNTYzZTJkYTYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.mCb4idpHzN8qVB1JPL9PuxIzQ_RNgQuc5VGFp_1K3Dg)
Error[2]: [myelinBuilderUtils.cpp::getMyelinSupportType::1270] Error Code 2: Internal Error (ForeignNode does not support data-dependent shape for now.)
My ONNX-model is correct. I checked it with code: check_onnx_model.py
![95096a7caec4f3f9c5f69d396b451cf7d14ab74f](https://private-user-images.githubusercontent.com/65890558/273566922-696e7916-d13e-4a94-88d7-cec3a15b31ad.jpeg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQyOTczMDEsIm5iZiI6MTcyNDI5NzAwMSwicGF0aCI6Ii82NTg5MDU1OC8yNzM1NjY5MjItNjk2ZTc5MTYtZDEzZS00YTk0LTg4ZDctY2VjM2ExNWIzMWFkLmpwZWc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwODIyJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDgyMlQwMzIzMjFaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1iZTk5NDYyOGFiOGJkNjI2ZWNjMzEwNzRjYzZiOTgyN2FhYWJlMmNhNzYyMjU4MzdlM2JhMmYxN2QxYjM1ZjVlJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.PkVDbcpoZj5q9jjNKIWS4M9ht6WNRukCzeE4lH0Dnuw)
Maybe I'm creating the ONNX model incorrectly...
I can't understand why this is happening? Could you help me solve this problem?
P.S. An Internet search did not provide answers to this problem. I have attached my ONNX model in the attachment below.Environment
TensorRT Version: 8.6
GPU Type: RTX3060
Nvidia Driver Version: nvidia-driver-535 (proprietary)
CUDA Version: 11.1
CUDNN Version: 8.0.4
Operating System + Version: Ubuntu 20.04
Python Version (if applicable): 3.8
TensorFlow Version (if applicable): 2.4.0
Relevant Files
model.h5:
https://drive.google.com/file/d/1LnM5j7HTzIKOXkHM546vxQPj2rJQdQZ2/view?usp=sharing
retinanet-bbox.onnx:
https://drive.google.com/file/d/1Tg7xYzWzyfRvIu3DhMNz5D2yrGviZTeM/view?usp=sharing
The text was updated successfully, but these errors were encountered: