2017-05-12 15 views
2

KerasにCPUの代わりにTensorflowのGPUバージョンを使用させるのに問題があります。私はkerasをインポートするたびに、それはちょうど言う:LinuxのTensorflowバックエンドを使用したKerasでCPUの代わりにGPUを使用する

>>> import keras 
Using TensorFlow backend 

...それが作業していて、CPU、GPUではない上だことを意味します。 私はクーダとcuDNNをインストールし、この環境を使用します。

conda create -n tensorflow python=3.5 anaconda 

私が最初tensorflowのCPUのバージョンをインストールして考える - 私はちょうど仕事にCUDAとcudnnを取得し、すべての一日を過ごすので、私は覚えていません。

pip install --ignore-installed --upgrade \ https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.1.0-cp35-cp35m-linux_x86_64.whl 

をし、それはまだ同じメッセージを与える: とにかく、私はあまりにもGPUのバージョンをインストールしました。

sess = tf.Session(config=tf.ConfigProto(log_device_placement=True)) 

が、私はこの出力を取得し、私は、デバイス0、私のGPU使用してい示す:私は、次のコードで使用されているデバイスをチェックしてみました、私は本当に物事を使い果たし

2017-05-12 02:14:10.746679: W 
tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow 
library wasn't compiled to use SSE4.1 instructions, but these are 
available on your machine and could speed up CPU computations. 
2017-05-12 02:14:10.746735: W   
tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow 
library wasn't compiled to use SSE4.2 instructions, but these are 
available on your machine and could speed up CPU computations. 
2017-05-12 02:14:10.746751: W 
tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow 
library wasn't compiled to use AVX instructions, but these are 
available on your machine and could speed up CPU computations. 
2017-05-12 02:14:10.746764: W 
tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow 
library wasn't compiled to use AVX2 instructions, but these are 
available on your machine and could speed up CPU computations. 
2017-05-12 02:14:10.746777: W 
tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow 
library wasn't compiled to use FMA instructions, but these are 
available on your machine and could speed up CPU computations. 
2017-05-12 02:14:10.926330: I 
tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:901] successful 
NUMA node read from SysFS had negative value (-1), but there must be 
at least one NUMA node, so returning NUMA node zero 
2017-05-12 02:14:10.926614: I 
tensorflow/core/common_runtime/gpu/gpu_device.cc:887] Found device 0 
with properties: 
name: GeForce GTX 1060 6GB 
major: 6 minor: 1 memoryClockRate (GHz) 1.7845 
pciBusID 0000:01:00.0 
Total memory: 5.93GiB 
Free memory: 5.51GiB 
2017-05-12 02:14:10.926626: I 
tensorflow/core/common_runtime/gpu/gpu_device.cc:908] DMA: 0 
2017-05-12 02:14:10.926629: I 
tensorflow/core/common_runtime/gpu/gpu_device.cc:918] 0: Y 
2017-05-12 02:14:10.926637: I 
tensorflow/core/common_runtime/gpu/gpu_device.cc:977] Creating 
TensorFlow device (/gpu:0) -> (device: 0, name: GeForce GTX 1060 6GB, 
pci bus id: 0000:01:00.0) 
Device mapping: 
/job:localhost/replica:0/task:0/gpu:0 -> device: 0, name: GeForce GTX 
1060 6GB, pci bus id: 0000:01:00.0 
2017-05-12 02:14:10.949871: I 
tensorflow/core/common_runtime/direct_session.cc:257] Device mapping: 
/job:localhost/replica:0/task:0/gpu:0 -> device: 0, name: GeForce GTX 
1060 6GB, pci bus id: 0000:01:00.0 

をする。私が残した唯一のことは、anacondaをアンインストールしてすべてを再インストールすることです。これは、文字通りケラとすべてで動作するように文字通り費やしてからです。(GPUではまだありません)

+0

この問題を解決できましたか。私はまったく同じ問題に直面していますか? – rjmessibarca

答えて

1

デフォルトのオプションでケラスをインストールするとCPUバージョンのテンソルフローがインストールされる可能性があります。あなたはすでにpip install tensorflow

pip install --upgrade --no-deps keras 

https://github.com/fchollet/keras/issues/5766

+0

要件が既に最新のもの:ケラス ./anaconda3/envs/tensorflow/lib/python3.5/site-packages - ケラスをアンインストールするにはどうすればよいですか?私はLinuxに新しいです – Shooth

+0

ok私はそれをアンインストールし、あなたのリンクを使用してそれを再インストールしても何も変わっていません – Shooth

+0

あなたはtensorflowのCPUバージョンをアンインストールしましたか? – MattMcKnight

0

を試してみました...そのバージョンをアンインストールしてから実行することができますか? pip install tensorflow-gpuはGPUバージョンをインストールしますが、これはCPUバージョンをインストールします。 https://www.tensorflow.org/install/

関連する問題