tensorflow报错:
2022-03-11 17:18:43.394107: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN)to use the following CPU instructions in performance-critical operations: AVX2
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
意思是你的 CPU 支持AVX AVX2 (可以加速CPU计算),但你安装的 TensorFlow 版本不支持
解决:
- 如果是初学者 或者 没有太大计算速度的需求,在开头加上这两行忽略这个提示即可
import os
os.environ[‘TF_CPP_MIN_LOG_LEVEL’] = ‘2’
ps:
os.environ[“TF_CPP_MIN_LOG_LEVEL”] = ‘1’ # 默认,显示所有信息
os.environ[“TF_CPP_MIN_LOG_LEVEL”] = ‘2’ # 只显示 warning 和 Error
os.environ[“TF_CPP_MIN_LOG_LEVEL”] = ‘3’ # 只显示 Error

看了下别人的安装教程:https://www.cnblogs.com/wxyao/p/12677089.html
Anaconda测试tensorflow是否安装成功
打开Anaconda prompt
输入:python
import tensorflow as tf
tf. version
tf. path
version是版本,path是安装路径
可以打印出安装成功的版本和安装路径
[En]
Can print out the version and installation path indicating that the installation is successful
成功了,但是因为报错所以选择重新装tensorflow。
不大行,装了很多个版本的还是不行,最后决定降低python版本下载tensorflow-2.0.0-cp37-cp37m-win_amd64.whl。来源:https://gitcode.net/mirrors/lakshayg/tensorflow-build?utm_source=csdn_github_accelerator
裂开了。看能不能解除warning,增加运行速度,球球了!
Original: https://blog.csdn.net/charono/article/details/123430170
Author: charono
Title: tensorflow2.0
原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/508927/
转载文章受原作者版权保护。转载请注明原作者出处!