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

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.

主站蜘蛛池模板: 元朗区| 湄潭县| 贵溪市| 云林县| 平南县| 印江| 中西区| 乌海市| 九龙城区| 田东县| 邳州市| 乾安县| 清涧县| 兰考县| 竹北市| 龙岩市| 兖州市| 雷山县| 静宁县| 嘉义县| 贵南县| 纳雍县| 荔浦县| 威海市| 扬中市| 大厂| 噶尔县| 嘉兴市| 天津市| 体育| 平山县| 施甸县| 仪陇县| 长乐市| 永和县| 广宁县| 乌鲁木齐市| 大荔县| 张家港市| 沾益县| 成武县|