tensorflow 2.1.0的安装错误

2024-09-27 23:19:49 发布

您现在位置:Python中文网/ 问答频道 /正文

  1. pip3 --version==pip 20.0.2 from /home/nitin/anaconda3/envs/tensorflow/lib/python3.7/site-packages/pip (python 3.7)
  2. python --version==python 3.7.6

我用conda create --name tensorflow创建了一个环境。我在它里面安装了tensorflow 2.0,我用conda也安装了tensorflow 2.0。我从tensorflow环境内部用pip install --upgrade tensorflow升级了它

现在,当我执行import tensorflow as tf时,我得到以下错误

2020-01-28 23:01:06.791110: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libnvinfer.so.6'; dlerror: libnvinfer.so.6: cannot open shared object file: No such file or directory 2020-01-28 23:01:06.791210: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libnvinfer_plugin.so.6'; dlerror: libnvinfer_plugin.so.6: cannot open shared object file: No such file or directory 2020-01-28 23:01:06.791226: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:30] Cannot dlopen some TensorRT libraries. If you would like to use Nvidia GPU with TensorRT, please make sure the missing libraries mentioned above are installed properly.

我似乎不明白出了什么问题。有什么帮助吗


Tags: pipdefaultstream环境versiontensorflowloaderconda
2条回答

这只是tensorflow发出的警告,指出如果您想改善某些模型的延迟和吞吐量,可以利用tensorRT的强大功能。但是,您无法使用它,因为未安装libnvere。 为了安装它,

wget http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64/nvidia-machine-learning-repo-ubuntu1604_1.0.0-1_amd64.deb

sudo apt install ./nvidia-machine-learning-repo-ubuntu1604_1.0.0-1_amd64.deb

sudo apt-get update

sudo apt-get install -y  no-install-recommends \
    libnvinfer6=6.0.1-1+cuda10.1 \
    libnvinfer-dev=6.0.1-1+cuda10.1 \
    libnvinfer-plugin6=6.0.1-1+cuda10.1

这是参考tensorflow提供的安装说明

如果您使用的是Python3.7CPU,那么将其升级为:pip install upgradehttps://storage.googleapis.com/tensorflow/linux/cpu/tensorflow_cpu-2.1.0-cp37-cp37m-manylinux2010_x86_64.whl

相关问题 更多 >

    热门问题