亚马逊 EC2 Tensorflow GPU 支持

Amazon EC2 Tensorflow GPU support

我试了很多次,但还没有找到解决方法。

我尝试过的事情包括检查所有路径和环境变量。

当我在深度学习 AMI (m4.xlarge)

上使用 Python 3.6 尝试使用 TensorFlow 后端 运行ning Keras 时

导入 Tensorflow 后,输出如下:

/home/ubuntu/anaconda3/envs/tensorflow_p36/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: compiletime version 3.5 of module 'tensorflow.python.framework.fast_tensor_util' does not match runtime version 3.6 return f(*args, **kwds)

运行:

print ("VERSION", tf.Session(config=tf.ConfigProto(log_device_placement=True)))

Returns:

2017-12-06 01:19:49.592416: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA 2017-12-06 01:19:49.603333: E tensorflow/stream_executor/cuda/cuda_driver.cc:406] failed call to cuInit: CUDA_ERROR_UNKNOWN 2017-12-06 01:19:49.603378: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:145] kernel driver does not appear to be running on this host (ip-172-31-41-243): /proc/driver/nvidia/version does not exist Device mapping: no known devices. 2017-12-06 01:19:49.604178: I tensorflow/core/common_runtime/direct_session.cc:299] Device mapping:

VERSION <tensorflow.python.client.session.Session object at 0x7f24f3d69c88>

为什么我无法让 GPU 达到 运行 的任何线索?

我觉得这个问题很有意思。要启用 GPU 支持,请确保您的实例中安装了任何受支持的 GPU 设备。据我所知,M4 实例不提供任何 GPU。

解决此问题的方法是,您应该启动一个具有 GPU 的新实例,例如 P3 和 P2 实例。 (个人摸索,建议先will spot instance,这样会比较划算。)然后运行再写一遍同样的代码,我觉得只要代码本身没有bug就可以了