I'm trying to run provided Mask RCNN sample. My environment is based on ngc container nvcr.io/nvidia/tensorrt:19.09-py.
Following the guide in repo, I finally converted h5 model to uff model. However the Mask RCNN sample encounter an error when parsing uff model to engine.
[09/14/2019-12:45:19] [E] [TRT] UffParser: Validator error: roi_align_mask_trt: Unsupported operation _PyramidROIAlign_TRT
I find this repo contains the plugin folder at root directory, which holds all custom plugin implementation. In my understanding, since those op layers are custom implemented, the sampleUffMaskRCNN cpp file should register those custom plugin in code. Why it is not?
Could anyone share some experience of how to use the plugin provided to run the Mask RCNN sample? Thanks.
Hi @rtrobin,
Maybe the plugins aren't linked correctly?
See the note about linking in this section in the README: https://github.com/NVIDIA/TensorRT#building-the-tensorrt-oss-components or this user's solution here: https://github.com/NVIDIA/TensorRT/issues/39#issuecomment-524197035
^^ Something like ln -s $TRT_BIN_DIR/libnvinfer_plugin.so $TRT_BIN_DIR/libnvinfer_plugin.so.6
This also might be related to https://github.com/NVIDIA/TensorRT/issues/132
Also, note that if you set environment variables before running your Docker container, such as:
export TRT_RELEASE=`pwd`/TensorRT-6.0.1.5
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$TRT_RELEASE/lib
These won't be set inside of the container, due to the nature of how containers work.
You can either just set these variables again once inside the container, or set them when launching your container with docker run ... -e TRT_RELEASE -e LD_LIBRARY_PATH ... and whatever other environment variables you may need: https://stackoverflow.com/a/45440570/10993413
@rmccorm4 Yes it is. I have fixed my problem already. Sorry I forgot to update my post.
@rtrobin Glad to hear. Can you please share how you fixed your problem just so that others can have it as a reference? It would be greatly appreciated!
@rmccorm4 I think your post above is a standard suggestion for this kind of problem. My solution is kind of tricky for this specific issue.
I use nv docker nvcr.io/nvidia/tensorrt:19.09-py as base environment, which already has tenorrt6 installed. I download the latest TensorRT code on v6.0.1 branch, and build it with only BUILD_PLUGINS ON. It will compile and generate a dynamic library libnvinfer_plugin.so.6.0.1.0. I replace /usr/lib/x86_64-linux-gnu/libnvinfer_plugin.so.6.0.1 with the newly build one, so that both c++ and python api could link the latest library.
Thanks for sharing @rtrobin !
I'm trying to run the MaskRCNN uff model on Jetson Xavier. Even after linking the plugin, I still get the following error. Any ideas how to fix this?
[00/31/2020-15:13:42] [I] Loading supplied plugin library: /usr/lib/aarch64-linux-gnu/libnvinfer_plugin.so.6.0.1
[00/31/2020-15:13:43] [E] [TRT] UffParser: Validator error: roi_align_mask_trt: Unsupported operation _PyramidROIAlign_TRT
[00/31/2020-15:13:43] [E] Failed to parse uff file
[00/31/2020-15:13:43] [E] Parsing model failed
[00/31/2020-15:13:43] [E] Engine could not be created
Most helpful comment
@rmccorm4 I think your post above is a standard suggestion for this kind of problem. My solution is kind of tricky for this specific issue.
I use nv docker nvcr.io/nvidia/tensorrt:19.09-py as base environment, which already has tenorrt6 installed. I download the latest TensorRT code on v6.0.1 branch, and build it with only
BUILD_PLUGINSON. It will compile and generate a dynamic librarylibnvinfer_plugin.so.6.0.1.0. I replace/usr/lib/x86_64-linux-gnu/libnvinfer_plugin.so.6.0.1with the newly build one, so that both c++ and python api could link the latest library.