Comments (5)
I still did not solve TensorRT problem ("TF-TRT Warning: Could not find TensorRT")
WSL2, Ubuntu 22.04, RTX 3090, Python 3.11, TensorFlow 2.15.1
(I installed TensorFlow as pip install tensorflow[and-cuda]==2.15.1
)
Once I execute
python3 -c "import tensorflow.compiler as tf_cc; \
print(tf_cc.tf2tensorrt._pywrap_py_utils.get_linked_tensorrt_version())"
I get the following error
2024-05-28 11:29:40.984287: E external/local_xla/xla/stream_executor/cuda/cuda_dnn.cc:9261] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered
2024-05-28 11:29:40.984330: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:607] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered
2024-05-28 11:29:40.984879: E external/local_xla/xla/stream_executor/cuda/cuda_blas.cc:1515] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered
2024-05-28 11:29:40.988008: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2024-05-28 11:29:41.499909: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
(8, 6, 1)
So, obviously, I need 8.6.1 version of TensorRT and I downloaded "TensorRT-8.6.1.6.Linux.x86_64-gnu.cuda-12.0.tar.gz"
After extract it, moved folder to "~/local/opt/TensorRT-8.6.1.6"
For example,
(tf_215_py_311_wsl) enhorse@DESKTOP-5950X:~/local/opt/TensorRT-8.6.1.6$ ls
bin data doc graphsurgeon include lib onnx_graphsurgeon python samples targets uff
Following Nvidia's installation instruction (https://docs.nvidia.com/deeplearning/tensorrt/install-guide/index.html#installing-tar)
I did
python3 -m pip install tensorrt-8.6.1-cp311-none-linux_x86_64.whl
python3 -m pip install tensorrt_lean-8.6.1-cp311-none-linux_x86_64.whl
python3 -m pip install tensorrt_dispatch-8.6.1-cp311-none-linux_x86_64.whl
python3 -m pip install onnx_graphsurgeon-0.3.12-py2.py3-none-any.whl
I added followings after open sudo nano ~/.bashrc
export LD_LIBRARY_PATH=/home/enhorse/local/opt/TensorRT-8.6.1.6/lib:$LD_LIBRARY_PATH
export TensorRT_ROOT=/home/enhorse/local/opt/TensorRT-8.6.1.6
When I execute the commend
strace -e open,openat python -c "import tensorflow as tf" 2>&1 | grep "libnvinfer\|TF-TRT"
I got as follows:
openat(AT_FDCWD, "/home/enhorse/local/opt/TensorRT-8.6.1.6/lib/libnvinfer.so.8.6.1", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/home/enhorse/local/opt/TensorRT-8.6.1.6/lib/libnvinfer_plugin.so.8.6.1", O_RDONLY|O_CLOEXEC) = 3
2024-05-28 11:41:21.209619: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
I still have no idea what I can do more. Is there something wrong in my installation?
from tensorflow.
@MohanKrishnaGR The standard approach of installing TensorRT directly on your Windows host might not work for WSL 2. Instead, you'll need to install it within the WSL 2 environment itself. Please make sure to follow these instructions. Within your WSL 2 environment, please print the value of LD_LIBRARY_PATH to confirm it includes the TensorRT directory and let us know?
Thank you!
from tensorflow.
@MohanKrishnaGR The library paths mentioned (/home/enhorse/local/opt/TensorRT-8.6.1.6/lib) might be incorrect or not set properly in the environment variables.
Kindly verify that and let us know?
Thank you!
from tensorflow.
Thanks, @sushreebarsa !
for
echo $LD_LIBRARY_PATH
I got:
/usr/local/cuda/lib64:/home/mohan/TensorRT-10.0.1.6/lib:
But still the TRT Warning: Could not find TensorRT exits:
(env) mohan@LAPTOP-INPO8147:~$ python3 -c "import tensorflow.compiler as tf_cc; \
print(tf_cc.tf2tensorrt._pywrap_py_utils.get_linked_tensorrt_version())"
2024-05-30 19:12:05.605386: I tensorflow/core/util/port.cc:113] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
2024-05-30 19:12:05.646956: E external/local_xla/xla/stream_executor/cuda/cuda_dnn.cc:9261] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered
2024-05-30 19:12:05.647012: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:607] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered
2024-05-30 19:12:05.647739: E external/local_xla/xla/stream_executor/cuda/cuda_blas.cc:1515] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered
2024-05-30 19:12:05.654095: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2024-05-30 19:12:06.221625: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
(8, 6, 1)
from tensorflow.
@MohanKrishnaGR,
Could you please try to execute the below commands and let us know if it working in Tensorflow v2.16.1
cd ~/miniconda3/envs/cuda12/lib/python3.11/site-packages/tensorrt_libs/
ln -s libnvinfer.so.10 libnvinfer.so.8.6.1
ln -s libnvinfer_plugin.so.10 libnvinfer_plugin.so.8.6.1
Thank you!
from tensorflow.
Related Issues (20)
- Rescaling Layer Issue when Loading .keras Model HOT 7
- Object Detection in Android using front camera: the detected bounding boxes are drawn incorrectly
- What is preventing TF to use GPU when used in native windows? HOT 16
- CMake Error: could not find requested file BuildFlatBuffers when cmake the lite kernel test HOT 2
- CMake Error: could not find requested file BuildFlatBuffers when cmake the lite kernel test
- tf.py_function does not output ragged tensors HOT 2
- Aborted (core dumped) in `tf.raw_ops.CropAndResizeGradImage` HOT 2
- Crash in `tf.raw_ops.UnsortedSegmentJoin/UnsortedSegmentMin/UnsortedSegmentMax/UnsortedSegmentProd/UnsortedSegmentSum` HOT 2
- error: no such file or directory: 'v2' when Bazel build for macOS HOT 6
- GCS gfile operations fail in TF 2.17.0rc0 and 2.18 nightly when not running in GCP HOT 9
- [Feature Request] Batch Renormalization HOT 1
- -
- Update curl from 8.4.0 to 8.6.0 due to security vulnerabilities CVE-2023-46219 and CVE-2023-46218 HOT 4
- Immediate Assistance Required: Issue with Converting Keras Model to TFLite HOT 2
- Help Needed: AttributeError in tf2onnx Conversion from ONNX to TensorFlow Model HOT 2
- In tflite, how to use the same memory to serve different models with exactly the same structure HOT 5
- Too many duplicate debug logs
- Cannot take the length of shape with unknown rank. HOT 16
- Non-deprecated tf.keras.preprocessing alternatives don't cover properly all the deprecated features HOT 3
- Some problems occur in the installation of TF-2.13.0 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tensorflow.