1

当我尝试在服务器上加载 Tensorflow 联合库时出现以下错误。我正在使用 tensorflow_federated 版本 0.13.1

我在服务器上的 Cuda 版本是 10.2 。Cudnn 库在 7.6 以上。

被问到的是什么"libnvinfer.so.6"

2020-03-28 17:26:18.357394: 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-03-28 17:26:18.410547: 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-03-28 17:26:18.464258: 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.
Traceback (most recent call last):
  File "FedAvgREALWORLDWork.py", line 52, in <module>
    import tensorflow_federated as tff
  File "/user/env/lib/python3.5/site-packages/tensorflow_federated/__init__.py", line 61, in <module>
    from tensorflow_federated.python import learning
  File "/user/env/lib/python3.5/site-packages/tensorflow_federated/python/learning/__init__.py", line 17, in <module>
    from tensorflow_federated.python.learning import framework
  File "/user/env/lib/python3.5/site-packages/tensorflow_federated/python/learning/framework/__init__.py", line 20, in <module>
    from tensorflow_federated.python.learning.framework.optimizer_utils import build_model_delta_optimizer_process
  File "/user/env/lib/python3.5/site-packages/tensorflow_federated/python/learning/framework/optimizer_utils.py", line 176
    f'({old_value.dtype}, {old_value.shape}) != '
    ^
SyntaxError: invalid syntax
4

1 回答 1

2

我认为您有一些库缺少“libvinfer”,例如要继续安装 cuda 10.1,您必须安装这些软件包

# Install TensorRT. Requires that libcudnn7 is installed above.
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

我建议你看到这个:https ://www.tensorflow.org/install/gpu 希望对你有所帮助

于 2020-03-29T14:30:49.433 回答