已解决Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2

已解决Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2

在这里插入图片描述

报错问题

之前在工作中遇到过这个坑,记录一下问题以及解决方法,不一定针对所有情况都能用,但是可以供大家参考。
问题描述如下:

在导入tensorflow后,进行运算时,出现了红色错误!

import tensorflow as tf

import numpy as np

在这里插入图片描述

解决方法

在这里插入图片描述
在最顶行写入

import os
os.environ[‘TF_CPP_MIN_LOG_LEVEL’] = ‘2’

此方法,只能可以临时屏蔽警告信息,看起来舒服了一些。

PS

有问题评论区留言即可

猜你喜欢

转载自blog.csdn.net/weixin_50843918/article/details/129992999