TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.

文章讨论了TensorFlow的警告,提示用户其二进制文件已优化使用部分CPU指令,建议在导入前设置环境变量以启用更多指令集,如SSE、AVX等。解决方法包括在importTensorFlow之前设置TF_CPP_MIN_LOG_LEVEL环境变量。
摘要由CSDN通过智能技术生成

WARNING原因如下:
TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: SSE SSE2 SSE3 SSE4.1 SSE4.2 AVX2 AVX512F AVX512_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.

这个警告是 TensorFlow 在启动时输出的信息,提醒用户一些当前 TensorFlow 二进制文件已经经过优化,以利用充分可用的 CPU 指令集执行性能关键的操作。同时,警告指出在其他操作中,还有额外的CPU指令集(如SSE、SSE2、SSE3、SSE4.1、SSE4.2、AVX2、AVX512F、AVX512_VNNI、FMA)是可以启用的,但目前还没有在TensorFlow编译时启用。

解决方法:在开头加两句

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

注意:这两行要写在import tensorflow前面
在这里插入图片描述

  • 18
    点赞
  • 23
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值