I am trying to train a CNN model using Keras using Tensorflow backend. The problem is, it won't run using my GPU (i.e. there is no speed up than when previously using tensorflow on CPU), despite the fact that I installed tensorflow-gpu and not the normal tensorflow as the solution described in this link.
I have installed CUDA version 9.0 and cuDNN version 7.1, received no issues as this link described.
I have also made sure that tensorflow is able to detect my GPU
[name: "/device:CPU:0"
device_type: "CPU"
memory_limit: 268435456
locality {
}
incarnation: 18032619952595111467
, name: "/device:GPU:0"
device_type: "GPU"
memory_limit: 3187841433
locality {
bus_id: 1
}
incarnation: 7706357628903921514
physical_device_desc: "device: 0, name: GeForce GTX 1050, pci bus id: 0000:01:00.0, compute capability: 6.1"
]
After some further researching, I have found this link. And my script didn't load the local cuDNN libraries.
EDIT
Below is a screenshot of the nvidia-smi.exe
, this is before and after I started the CNN training (i.e. no changes).
EDIT v2
Ok, I have made some little progress, turns out there is something weird with running the script in Spyder, so I ran it using python my_python_script.py
in Command Prompt. I can say for sure that the GPU is recognized by tensorflow, as Keras has given jobs to the GPU. But, I still get 0% utilization
I don't know what else could be wrong. Please help.
Thanks in advance!