Как устранить предупреждения для Tensorflow -GPU? - PullRequest
1 голос
/ 05 августа 2020

Я пытаюсь установить tenorflow-gpu в python, ubuntu 18.04, используя команду pip как pip install tensorflow-gpu==2.1.0, когда я запускаю эту команду: import tensorflow as tf Я получаю следующую ошибку:

>>> import tensorflow as tf
2020-08-04 16:06:41.659287: 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; LD_LIBRARY_PATH: /usr/local/cuda-10.1/lib64
2020-08-04 16:06:41.659398: 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; LD_LIBRARY_PATH: /usr/local/cuda-10.1/lib64
2020-08-04 16:06:41.659413: 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.

И когда я запускаю tf.test.is_gpu_available(), я получаю True, но у меня много следующих предупреждений:

WARNING:tensorflow:From <stdin>:1: is_gpu_available (from tensorflow.python.framework.test_util) is deprecated and will be removed in a future version.
Instructions for updating:
Use `tf.config.list_physical_devices('GPU')` instead.
2020-08-04 16:08:33.381085: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2020-08-04 16:08:33.423734: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2199995000 Hz
2020-08-04 16:08:33.425574: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x41e6da0 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2020-08-04 16:08:33.425653: I tensorflow/compiler/xla/service/service.cc:176]   StreamExecutor device (0): Host, Default Version
2020-08-04 16:08:33.432949: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcuda.so.1
2020-08-04 16:08:33.580069: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-08-04 16:08:33.580423: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x4282490 initialized for platform CUDA (this does not guarantee that XLA will be used). Devices:
2020-08-04 16:08:33.580441: I tensorflow/compiler/xla/service/service.cc:176]   StreamExecutor device (0): GeForce GTX 1060, Compute Capability 6.1
2020-08-04 16:08:33.580561: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-08-04 16:08:33.580785: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1555] Found device 0 with properties: 
pciBusID: 0000:01:00.0 name: GeForce GTX 1060 computeCapability: 6.1
coreClock: 1.733GHz coreCount: 10 deviceMemorySize: 5.94GiB deviceMemoryBandwidth: 178.99GiB/s
2020-08-04 16:08:33.583471: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudart.so.10.1
2020-08-04 16:08:33.641250: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcublas.so.10
2020-08-04 16:08:33.675210: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcufft.so.10
2020-08-04 16:08:33.683125: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcurand.so.10
2020-08-04 16:08:33.744338: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcusolver.so.10
2020-08-04 16:08:33.753194: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcusparse.so.10
2020-08-04 16:08:33.763988: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudnn.so.7
2020-08-04 16:08:33.764318: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-08-04 16:08:33.765495: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-08-04 16:08:33.766332: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1697] Adding visible gpu devices: 0
2020-08-04 16:08:33.766456: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudart.so.10.1
2020-08-04 16:08:33.769895: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1096] Device interconnect StreamExecutor with strength 1 edge matrix:
2020-08-04 16:08:33.769951: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1102]      0 
2020-08-04 16:08:33.769973: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1115] 0:   N 
2020-08-04 16:08:33.770273: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-08-04 16:08:33.771146: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-08-04 16:08:33.771798: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1241] Created TensorFlow device (/device:GPU:0 with 4847 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1060, pci bus id: 0000:01:00.0, compute capability: 6.1)
True

Я не уверен, прерывают ли эти предупреждения / ошибки использование GPU. Как решить эту проблему?

1 Ответ

0 голосов
/ 06 августа 2020

В вашем первом журнале просто говорится, что вы не устанавливали TensorRT . Если вы не хотите использовать эту функцию тензорного потока, просто забудьте об этом предупреждении.

Тогда для вашего теста gpu у вашего журнала нет проблем, и вы можете сфокусировать часть матрицы gpu

# tf.test.is_gpu_available() on my machine, which has three gpu
   0  1  2
0: N  N  N
1: N  N  N
2: N  N  N

и конечный результат

True

Кстати, если вы хотите отключить эти скучные журналы, вы можете установить, как показано ниже.

''' TF_CPP_MIN_LOG_LEVEL
0 = all messages are logged (default behavior)
1 = INFO messages are not printed
2 = INFO and WARNING messages are not printed
3 = INFO, WARNING, and ERROR messages are not printed
'''
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...