2021-07-08

当你使用keras.models.load_model加载TensorFlow模型时,系统提示信息表明该TensorFlow版本已针对AVX和AVX2指令集进行优化,这意味着它将利用这些CPU特性以提高性能。这不是错误,而是表明模型加载过程将尽可能快地运行,利用硬件的高级向量扩展功能。
摘要由CSDN通过智能技术生成

keras.models.load_model(path)

用到这个函数的时候会显示如下红色字体

2021-07-08 10:30:40.633573: 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: AVX AVX2
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.

stackoverflow上找到了问题的解答

An important part of Tensorflow is that it is supposed to be fast. With a suitable installation, it works with CPUs, GPUs, or TPUs. Part of going fast means that it uses different code depending on your hardware. Some CPUs support operations that other CPUs do not, such as vectorized addition (adding multiple variables at once). Tensorflow is simply telling you that the version you have installed can use the AVX and AVX2 operations and is set to do so by default in certain situations (say inside a forward or back-prop matrix multiply), which can speed things up. This is not an error, it is just telling you that it can and will take advantage of your CPU to get that extra speed out.

Note: AVX stands for Advanced Vector Extensions.

翻译如下

Tensorflow的一个重要部分是,它应该是快速的。通过合适的安装,它可以在CPU、GPU或TPU上工作。快速的一部分意味着,它根据你的硬件使用不同的代码。一些CPU支持其他CPU不支持的操作,如矢量加法(一次添加多个变量)。Tensorflow只是告诉你,你所安装的版本可以使用AVX和AVX2操作,并且在某些情况下默认设置为这样做(比如在正向或反向矩阵乘法里面),这可以加快事情的进展。这不是一个错误,它只是告诉你,它可以而且会利用你的CPU来获得额外的速度。

注意:AVX代表高级向量扩展。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值