官术网_书友最值得收藏!

Testing your installation

To test whether you have successfully installed or not, you can run the following snippet in Python. If you have installed the GPU version, import TensorFlow in Python and run the following:

>>>import tensorflow as tf
>>>sess = tf.Session(config=tf.ConfigProto(log_device_placement=True))

This will return the details about the GPU card and other details that TensorFlow is compiled to use, if you have successfully installed the GPU version.

To check the installation properly (irrespective of CPU or GPU version), we will perform the following simple tensor multiplication operation:

>>>t1 = tf.constant([8.0, 4.0, 3.0, 10.0, 9.0, 2.0], shape = [2,3],name='tensor1')
>>>t2 = tf.constant([12.0, 6.0, 4.0, 5.0, 9.0, 1.0], shape = [3,2],name='tensor2')
>>>out = tf.matmul(t1, t2)
>>>sess = tf.Session()
>>>print(session.run(out))

This code must print the element-wise multiplied output of the two tensors.

主站蜘蛛池模板: 会泽县| 河津市| 宜阳县| 循化| 水城县| 富平县| 巴南区| 丰城市| 藁城市| 会同县| 民和| 潜江市| 乐东| 汝州市| 改则县| 鸡西市| 阿克苏市| 三台县| 铜陵市| 台南市| 遂川县| 勐海县| 敦化市| 班戈县| 浑源县| 长宁区| 乐昌市| 礼泉县| 黑山县| 礼泉县| 霍州市| 汽车| 登封市| 湖南省| 连州市| 开平市| 广水市| 新余市| 杭州市| 新绛县| 镇雄县|