After a an install without pb, I am trying the tutorial about GPUs : I type :
with tf.device('/gpu:0'):
a = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[2, 3], name='a')
b = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[3, 2], name='b')
c = tf.matmul(a, b)
print(c)
sess.run(c)
I got :
Tensor("MatMul_1:0", shape=TensorShape([Dimension(2), Dimension(2)]), dtype=float32, device=/gpu:0)
.
Traceback (most recent call last): File "", line 1, in File "/home/olivier/anaconda/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 345, in run results = self._do_run(target_list, unique_fetch_targets, feed_dict_string) File "/home/olivier/anaconda/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 419, in _do_run e.code) tensorflow.python.framework.errors.InvalidArgumentError: Cannot assign a device to node 'b_1': Could not satisfy explicit device specification '/gpu:0' [[Node: b_1 = Constdtype=DT_FLOAT, value=Tensor, _device="/gpu:0"]] Caused by op u'b_1', defined at: File "", line 3, in File "/home/olivier/anaconda/lib/python2.7/site-packages/tensorflow/python/ops/constant_op.py", line 147, in constant attrs={"value": tensor_value, "dtype": dtype_value}, name=name).outputs[0] File "/home/olivier/anaconda/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 1710, in create_op original_op=self._default_original_op, op_def=op_def) File "/home/olivier/anaconda/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 988, in init self._traceback = _extract_stack()
In Torch7, my GPU works normally