-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Internal Error (Could not find any implementation for node {...Tensordot/Reshape}) failure of TensorRT 8.6 when running generate INT8 engine on GPU RTX3080 #4291
Comments
Here is the onnx model file, you can use it directly, or generate a new model with before codes. |
@yjiangling I see the TRT version you used is quite old. Would you like to try the latest 10.7 to check if the error still occurs? |
@yuanyao-nv Yes, I'will try to install the latest docker images and try it again, but for some reason, we must run our models on tensorrt8.6 so far, so could you please help to investigate what's wrong with it ? In my experiments, I found if remove the code |
@asfiyab-nvidia Could you please give some helps? many thanks, your partener assigned last week maybe on vacation or too busy, hoping to receive some suggestions from your team, thanks again.
So, it seems that there is something wrong with the cailbration cache file generate from polygraphy convert before? |
@lix19937 May I have your help? Many thanks. |
Do a test by follow cmd trtexec --onnx=onnx_model/model.onnx \
--minShapes=xs:1x1120,xlen:1 \
--optShapes=xs:1x160000,xlen:1 \
--maxShapes=xs:1x480000,xlen:1 \
--minShapesCalib=xs:1x1120,xlen:1 \
--optShapesCalib=xs:1x160000,xlen:1 \
--maxShapesCalib=xs:1x480000,xlen:1 \
--workspace=10240 \
--int8 \
--saveEngine=trt_model/trt86_minmax_int8.plan \
--verbose \
--buildOnly > trt_model/result-INT8.txt Second, polygraphy depends on trt, you should make sure the version match with your trtexec (nvinfer), you can use c++ to do a ptq for your onnx to get calib.table. |
@lix19937 Thanks a lot. Yes, the test above without calibration cashe file is OK, and the version of polygraphy is 0.47.1, is it math with the trtexec? How to check if the version match with trtexec (nvinfer)? That is to say, the calibration cache file generated by the data_loader.py sacript in Python is not fine, right? I should use c++ to do the int8 calibration? |
polygraphy has trt(py) backend, so you need make sure your trt(py) version. If you want to use your current trt(cpp), you can ref https://github.com/lix19937/trt-samples-for-hackathon-cn/tree/master/cookbook/03-BuildEngineByTensorRTAPI/MNISTExample-pyTorch/C%2B%2B |
@lix19937 Thank you so much, sorry for the misunderstanding, infact I always use TensorRT in Python instead of C++. And the trt(py) version I used is 8.6.1, is it suitable for polygraphy with 0.47.1 version? What version of polygraphy I should use for TensorRT8.6.1? |
you can run follow to see nvinfer.so version find / -name libtensorrt.so
ldd -r ${YOUR_libtensorrt.so_location} |grep libnvinfer.so |
Is it your onnx which current used ? |
@lix19937 Thanks again for the helps, I'm so sorry for the late reply.
|
Hi,
I'm using TensorRT8.6 to conduct int8 calibration and genereate tensorrt engine with polygraphy tools like this
polygraphy convert onnx_model/model.onnx --trt-min-shapes xs:[1,1120] xlen:[1] --trt-opt-shapes xs:[1,160000] xlen:[1] --trt-max-shapes xs:[1,480000] xlen:[1] --int8 --data-loader-script data_loader.py --calibration-cache trt86_minmax_calib.cache --calib-base-cls IInt8MinMaxCalibrator --output trt_model/trt86_minmax_int8.plan
, but it always give the following error:
The convert onnx model is generated from the saved model, which produced with codes as below:
Then, convert saved model to onnx model with
python3 -m tf2onnx.convert --opset 13 --saved-model ./saved_model/ --output ./onnx_model/model.onnx
, what's wrong with it ?By the way, the file data_loader.py is used for int8 calibration, you can reproduce it like this:
Anyone can give some helps? Thanks a lot for the help!!!
The text was updated successfully, but these errors were encountered: