Search code examples
tensorflow-federated

Error when running TensorFlow Federated on server


I am getting the following error when I try to load the Tensorflow Federated library on a server. I am using tensorflow_federated version 0.13.1

The Cuda version I have on the server is 10.2 . The Cudnn library is above 7.6.

What is the "libnvinfer.so.6" that is being asked?

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

Solution

  • I think that you have some librares are missing "libvinfer", for example to continue install cuda 10.1 you must install these packages

    # 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
    

    I suggest that you See this : https://www.tensorflow.org/install/gpu I hope that help you