【tensorflow入门】1、简单的tensorflow小程序+警告 this TensorFlow binary was not compiled to use

这篇博客介绍了如何入门TensorFlow,通过Python代码演示了矩阵乘法操作,并针对出现的'Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2'警告提供了两种解决方案:设置环境变量忽略警告或重新编译TensorFlow源码以兼容AVX。
摘要由CSDN通过智能技术生成

1、用命令行进入tensorflow的python编程位置

C:\Users\aDreamer>activate tensorflow

(tensorflow) C:\Users\aDreamer>python
Python 3.5.2 |Continuum Analytics, Inc.| (default, Jul  5 2016, 11:41:13) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

 

2、输入代码
>>> import tensorflow as tf         #加载tensorflow(导入tensorflow包)
>>> m1=tf.constant([[3,3]])         #定义矩阵常量m1、m2
>>> m2=tf.constant([[2],[3]])     
>>> product=tf.matmul(m1,m2) #创建矩阵乘法op,m1、m2相乘
>>> print(product)                      #打印op
Tensor("MatMul:0", shape=(1, 1), dtype=int32)
>>> sess=tf.Session()               #创建会话
2019-05-27 08:41:23.500628: I tensor

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值