Reputation: 857
I made neural nets with tensorflow but tnesorflow-gpu is slower than cpu!
total running(training) time is 130sec in tensorflow 2.1 and 330sec in tensorflow-gpu 2.1
My CPU is i7-7th gen and GPU is geforce-930M(laptop environments) It's because my GPU is slower than CPU? If so, Can I setup to run GPU automatically in appropriate situation only?
(CUDA environments seems appropriately setup, also I manually checked that tensorflow 2.1 is using CPU only and tensorflow-gpu 2.1 is using both CPU and GPU.)
update : My neural network's size is 64 x 32 x 16 x 1(maybe not fitting in parallel execution) and in tensorflow 2.1, I turn off GPU by this commands as follows.
import os
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"] = ""
Upvotes: 0
Views: 241
Reputation: 15053
As of TensorFlow 2.1, the GPU support is also available in the tensorflow
package, not only tensorflow-gpu
; if you use import tensorflow as tf
it defaults to GPU usage if it finds one; I would personally first uninstall tensorflow-gpu
and leave only the plain tensorflow
package.
Upvotes: 3