在CPU上运行Tensorflow

如果你是用的GPU版本的Tensorflow,你可以这样来使用CPU版本的Tensorlfow:

config = tf.ConfigProto(
        device_count = {'GPU': 0}
    )
sess = tf.Session(config=config)