运行 服务器上的 TensorFlow Federated 时出错

Error when running TensorFlow Federated on server

当我尝试在服务器上加载 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

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