没有CUDA?在Rstudio错误上安装keras / tensorflow:错误:未找到Python模块tensorflow.python.keras

时间:2019-07-13 19:47:14

标签: python r keras

我正在尝试在rstudio上运行keras。我已经在服务器上设置了它。当我使用install_keras()安装它时可以正常工作,但是我想要gpu访问,所以我尝试了install_keras(method = "virtualenv", version = "gpu"),现在当我尝试运行任何命令tokenizer <- text_tokenizer(num_words = 20000)时出现错误。我已经尽一切努力解决这个问题...

Error: Python module tensorflow.python.keras was not found.

Detected Python configuration:

python:         /data/users/USER/.virtualenvs/r-tensorflow/bin/python
libpython:      /usr/lib64/libpython2.7.so.1.0
pythonhome:     /usr:/usr
virtualenv:     /data/users/USER/.virtualenvs/r-tensorflow/bin/activate_this.py
version:        2.7.5 (default, Jun 11 2019, 12:19:05)  [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]
numpy:          /data/users/USER/.virtualenvs/r-tensorflow/lib/python2.7/site-packages/numpy
numpy_version:  1.16.4
tensorflow:     /data/users/USER/.virtualenvs/r-tensorflow/lib/python2.7/site-packages/tensorflow

python versions found: 
 /data/users/USER/.virtualenvs/r-tensorflow/bin/python
 /usr/bin/python
 /usr/bin/python3
 /data/users/USER/env/bin/python

我认为它使用libpython2.7,但是当我运行install_keras(method = "virtualenv", version = "gpu")时,我不知道要指定哪个python,我在服务器上安装了python3.6。

> Sys.which("python")
                                                   python 
"/data/users/USER/.virtualenvs/r-tensorflow/bin/python" 
> use_python("/data/users/USER/.virtualenvs/r-tensorflow/bin/python2.7")
> Sys.which("python")
                                                   python 
"/data/users/USER/.virtualenvs/r-tensorflow/bin/python"

我也尝试过:

use_condaenv('/data/users/USER/.virtualenvs/r-tensorflow') mnist <- dataset_mnist()

给出与上面相同的错误。

我现在在哪里:

> sess = k$get_session()
2019-07-13 22:58:51.029412: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 AVX512F FMA
2019-07-13 22:58:51.065751: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library libcuda.so.1
2019-07-13 22:58:52.624324: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x1ed77740 executing computations on platform CUDA. Devices:
2019-07-13 22:58:52.624418: I tensorflow/compiler/xla/service/service.cc:175]   StreamExecutor device (0): Tesla V100-PCIE-16GB, Compute Capability 7.0
2019-07-13 22:58:52.633197: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2300000000 Hz
2019-07-13 22:58:52.645011: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x1d332940 executing computations on platform Host. Devices:
2019-07-13 22:58:52.645055: I tensorflow/compiler/xla/service/service.cc:175]   StreamExecutor device (0): <undefined>, <undefined>
2019-07-13 22:58:52.646280: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1640] Found device 0 with properties: 
name: Tesla V100-PCIE-16GB major: 7 minor: 0 memoryClockRate(GHz): 1.38
pciBusID: 0000:3b:00.0
2019-07-13 22:58:52.646918: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Could not dlopen library 'libcudart.so.10.0'; dlerror: libcudart.so.10.0: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/lib64/R/lib::/lib:/usr/lib/jvm/jre/lib/amd64/server:/usr/lib/jvm/jre/lib/amd64:/usr/lib/jvm/java/lib/amd64:/usr/java/packages/lib/amd64:/lib:/usr/lib
2019-07-13 22:58:52.647010: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Could not dlopen library 'libcublas.so.10.0'; dlerror: libcublas.so.10.0: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/lib64/R/lib::/lib:/usr/lib/jvm/jre/lib/amd64/server:/usr/lib/jvm/jre/lib/amd64:/usr/lib/jvm/java/lib/amd64:/usr/java/packages/lib/amd64:/lib:/usr/lib
2019-07-13 22:58:52.647104: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Could not dlopen library 'libcufft.so.10.0'; dlerror: libcufft.so.10.0: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/lib64/R/lib::/lib:/usr/lib/jvm/jre/lib/amd64/server:/usr/lib/jvm/jre/lib/amd64:/usr/lib/jvm/java/lib/amd64:/usr/java/packages/lib/amd64:/lib:/usr/lib
2019-07-13 22:58:52.647190: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Could not dlopen library 'libcurand.so.10.0'; dlerror: libcurand.so.10.0: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/lib64/R/lib::/lib:/usr/lib/jvm/jre/lib/amd64/server:/usr/lib/jvm/jre/lib/amd64:/usr/lib/jvm/java/lib/amd64:/usr/java/packages/lib/amd64:/lib:/usr/lib
2019-07-13 22:58:52.647281: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Could not dlopen library 'libcusolver.so.10.0'; dlerror: libcusolver.so.10.0: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/lib64/R/lib::/lib:/usr/lib/jvm/jre/lib/amd64/server:/usr/lib/jvm/jre/lib/amd64:/usr/lib/jvm/java/lib/amd64:/usr/java/packages/lib/amd64:/lib:/usr/lib
2019-07-13 22:58:52.647364: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Could not dlopen library 'libcusparse.so.10.0'; dlerror: libcusparse.so.10.0: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/lib64/R/lib::/lib:/usr/lib/jvm/jre/lib/amd64/server:/usr/lib/jvm/jre/lib/amd64:/usr/lib/jvm/java/lib/amd64:/usr/java/packages/lib/amd64:/lib:/usr/lib
2019-07-13 22:58:52.647451: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Could not dlopen library 'libcudnn.so.7'; dlerror: libcudnn.so.7: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/lib64/R/lib::/lib:/usr/lib/jvm/jre/lib/amd64/server:/usr/lib/jvm/jre/lib/amd64:/usr/lib/jvm/java/lib/amd64:/usr/java/packages/lib/amd64:/lib:/usr/lib
2019-07-13 22:58:52.647461: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1663] Cannot dlopen some GPU libraries. Skipping registering GPU devices...
2019-07-13 22:58:52.647485: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1181] Device interconnect StreamExecutor with strength 1 edge matrix:
2019-07-13 22:58:52.647493: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1187]      0 
2019-07-13 22:58:52.647503: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1200] 0:   N

编辑:我不认为我已经安装了CUDA ...-这就是为什么我会出错?

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 396.37                 Driver Version: 396.37                    |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  Tesla V100-PCIE...  Off  | 00000000:3B:00.0 Off |                    0 |
| N/A   35C    P0    36W / 250W |    419MiB / 16160MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0    312745      C   /usr/lib/rstudio-server/bin/rsession         408MiB |
+-----------------------------------------------------------------------------+

0 个答案:

没有答案