【笔记】解决Ubuntu 23.04下Warning: Could not find TensorRT的问题

1. 有一块quadro显卡,想要试用一下, 先使用conda list安装了tensorflow 和 tensorrt

代码:

import tensorflow as tf

print(tf.test.is_built_with_cuda())

print(tf.config.list_physical_devices('GPU'))

遇到如下问题:

W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT

True

W tensorflow/core/common_runtime/gpu/gpu_device.cc:1960] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform.
Skipping registering GPU devices...

[]

文章来源地址https://uudwc.com/A/9djo5

2. 添加import tensorrt as trt解决问题,而且tensorrt必须在tensorflow前面

代码:

import tensorrt as trt

import tensorflow as tf

print(tf.test.is_built_with_cuda())

print(tf.config.list_physical_devices('GPU'))

结果:

True
[PhysicalDevice(name='/physical_device:GPU:0', device_type='GPU')]

原文地址:https://blog.csdn.net/miles2007/article/details/132561059

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请联系站长进行投诉反馈,一经查实,立即删除!

上一篇 2023年09月28日 06:33
【AI绘画】Stable Diffusion WebUI
下一篇 2023年09月28日 08:04