首页
学习
活动
专区
圈层
工具
发布
社区首页 >专栏 >tensorfolw很多的函数不能使用,具体解决方法:

tensorfolw很多的函数不能使用,具体解决方法:

作者头像
川川菜鸟
发布于 2021-10-18 10:11:41
发布于 2021-10-18 10:11:41
5240
举报

经过挣扎,我安装好了tensorflow,但是运行还是出现警告:

Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2

就是说我不能完全使用AVX2

原来代码:

代码语言:javascript
复制
import tensorflow as tf  # 导入TensorFlow的包

s= tf.constant([[1, 2, 3], [4, 5, 6]])  # 这里定义了一个Tensor
print("s", s)  

解决方案:忽略警告就好了,于是我们在原来代码加入新的部分:

代码语言:javascript
复制
import os 

os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' 

所以新的代码为:

代码语言:javascript
复制
import tensorflow as tf  # 导入TensorFlow的包
import os

os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
s= tf.constant([[1, 2, 3], [4, 5, 6]])  # 这里定义了一个Tensor
print("s", s)  
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2020/10/12 ,如有侵权请联系 cloudcommunity@tencent.com 删除
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档