tensorflow (一)hello Tensorflow 检验tensorflow是否成功安装

本文通过一个简单的示例演示了如何使用TensorFlow进行基本操作,包括环境配置、会话管理及常量运算,验证了TensorFlow在Python环境下的正确安装与运行。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Python 3.5.2 |Anaconda 4.2.0 (64-bit)| (default, Jul  2 2016, 17:53:06) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> sess=tf.Session()
2018-11-05 15:13:12.817746: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2
>>> import tensorflow as tf
>>> hello = tf.constant('hello, Tensorflow!')
>>> sess = tf.Session()
>>> print(sess.run(hello))
b'hello, Tensorflow!'

终端运行的一个关于tensorflow的一个小demo,目的是检验自己的tensorflow

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值