我该如何解决conda tensorflow安装错误的此错误?

时间:2019-09-26 16:32:31

标签: tensorflow cuda nvidia

如何解决此错误?

>>> import tensorflow as tf
>>> tf.Session(config=tf.ConfigProto(log_device_placement=True))
2019-09-26 12:28:37.749941: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA
2019-09-26 12:28:37.756897: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2993275000 Hz
2019-09-26 12:28:37.758229: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x5636b6113300 executing computations on platform Host. Devices:
2019-09-26 12:28:37.758293: I tensorflow/compiler/xla/service/service.cc:175]   StreamExecutor device (0): <undefined>, <undefined>
2019-09-26 12:28:37.759374: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library libcuda.so.1
2019-09-26 12:28:37.782412: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1640] Found device 0 with properties: 
name: Quadro P4000 major: 6 minor: 1 memoryClockRate(GHz): 1.48
pciBusID: 0000:03:00.0
2019-09-26 12:28:37.782612: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library libcudart.so.10.1
2019-09-26 12:28:37.784210: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library libcublas.so.10
2019-09-26 12:28:37.785800: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library libcufft.so.10
2019-09-26 12:28:37.786057: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library libcurand.so.10
2019-09-26 12:28:37.787715: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library libcusolver.so.10
2019-09-26 12:28:37.788633: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library libcusparse.so.10
2019-09-26 12:28:37.792187: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library libcudnn.so.7
2019-09-26 12:28:37.793278: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1763] Adding visible gpu devices: 0
2019-09-26 12:28:37.793314: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library libcudart.so.10.1
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/joshij/yes/envs/TF/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1570, in __init__
    super(Session, self).__init__(target, graph, config=config)
  File "/home/joshij/yes/envs/TF/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 693, in __init__
    self._session = tf_session.TF_NewSessionRef(self._graph._c_graph, opts)
tensorflow.python.framework.errors_impl.InternalError: cudaGetDevice() failed. Status: CUDA driver version is insufficient for CUDA runtime version
>>> 

nvidia-smi命令的输出

Thu Sep 26 12:53:39 2019       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 387.26                 Driver Version: 387.26                    |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  Quadro P4000        Off  | 00000000:03:00.0  On |                  N/A |
| 46%   43C    P0    29W / 105W |   1023MiB /  8080MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0       677      G   ...quest-channel-token=5147126485013694581    54MiB |
|    0      1900      G   /usr/libexec/Xorg                            214MiB |
|    0      2182      G   /usr/libexec/Xorg                            331MiB |
|    0      2416      G   /usr/bin/gnome-shell                         172MiB |
|    0      3154      G   ...uest-channel-token=13678957064081588319   207MiB |
+-----------------------------------------------------------------------------+

1 个答案:

答案 0 :(得分:2)

使用nvidia-smi命令检查驱动程序版本。看来您的nvidia驱动程序版本已经过时。它应该大于410,因为您使用的是cuda10。请尝试升级驱动程序版本。