在服务器上运行TensorFlow联合时出错

时间:2020-03-28 16:32:38

标签: tensorflow-federated

当我尝试在服务器上加载Tensorflow Federated库时,出现以下错误。我正在使用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

1 个答案:

答案 0 :(得分:2)

我认为您有一些librares缺少“ 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 希望对您有帮助

相关问题