- Hands-On Deep Learning Architectures with Python
- Yuxi (Hayden) Liu Saransh Mehta
- 130字
- 2021-06-24 14:48:14
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.
推薦閱讀
- Mastering Spark for Data Science
- Canvas LMS Course Design
- 高性能混合信號(hào)ARM:ADuC7xxx原理與應(yīng)用開(kāi)發(fā)
- Managing Mission:Critical Domains and DNS
- 走入IBM小型機(jī)世界
- Learning Apache Cassandra(Second Edition)
- STM32嵌入式微控制器快速上手
- 信息物理系統(tǒng)(CPS)測(cè)試與評(píng)價(jià)技術(shù)
- Blender 3D Printing by Example
- 多媒體制作與應(yīng)用
- 基于神經(jīng)網(wǎng)絡(luò)的監(jiān)督和半監(jiān)督學(xué)習(xí)方法與遙感圖像智能解譯
- 嵌入式操作系統(tǒng)原理及應(yīng)用
- Visual FoxPro程序設(shè)計(jì)
- R Machine Learning Projects
- AVR單片機(jī)工程師是怎樣煉成的