Run tensorflow on CPU
I've got a model, which is trained on gpu. Obviously I've installed tensorflow-gpu, but can I run my model on cpu?
I've got a model, which is trained on gpu. Obviously I've installed tensorflow-gpu, but can I run my model on cpu?
Just change the environment variable
import os
os.environ['CUDA_VISIBLE_DEVICES'] = '-1'
You can also do it with tensorflow python api
config = tf.ConfigProto(device_count = {'GPU': 0})
sess = tf.Session(config=config)