TensorFlow 1.0 does not see the GPU on Windows (but Theano does)

I have a running installation of Keras and Theano on Windows (following this tutorial ). Now I tried switching the backend to Tensorflow , which worked pretty well.

The only problem I encountered is that Tensorflow does not detect my GPU , which, according to Theano, does:

from tensorflow.python.client import device_lib
def get_available_gpus():
    local_device_protos = device_lib.list_local_devices()
    return [x.name for x in local_device_protos if x.device_type == 'GPU']

does not give results, but when working with Theano backend it works pretty well:

C:\Programming\Anaconda3\python.exe D:/cnn_classify_cifar10.py 
Using Theano backend.
DEBUG: nvcc STDOUT nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
mod.cu
    Creating library C:/Users/Alex/AppData/Local/Theano/compiledir_Windows-10-10.0.14393-SP0-Intel64_Family_6_Model_60_Stepping_3_GenuineIntel-3.5.2-64/tmpgsy496fe/m91973e5c136ea49268a916ff971b7377.lib and object C:/Users/Alex/AppData/Local/Theano/compiledir_Windows-10-10.0.14393-SP0-Intel64_Family_6_Model_60_Stepping_3_GenuineIntel-3.5.2-64/tmpgsy496fe/m91973e5c136ea49268a916ff971b7377.exp

Using gpu device 0: GeForce GTX 770 (CNMeM is enabled with initial size: 80.0% of memory, cuDNN 5005)

Apparently some configuration is missing, but I don't know what. For Theano to work correctly, I needed a file with a name ~/.theanorcwith the following contents:

[global]
device = gpu
floatX = float32

[cuda]
root = C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0

[nvcc]
flags=-LC:C:\Programming\WinPython-64bit-3.5.2.2\python-3.5.2.amd64\libs

, - , , Theano?. Linux (?).

Gist ( ).

, Tensorflow?

+4
1

, tensorflow-gpu .

( ), tensorflow-gpu ( gpu) 1.0

+4

Source: https://habr.com/ru/post/1670882/


All Articles