未使用 TensorFlow 编译的 CPU 指令 [英] CPU instructions not compiled with TensorFlow

查看:26
本文介绍了未使用 TensorFlow 编译的 CPU 指令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

MacBook Air:OSX El Capitan

MacBook Air: OSX El Capitan

当我在终端 (python 3 tfpractice.py) 中运行 TensorFlow 代码时,我得到比正常时间更长的等待时间来获取输出,然后出现以下错误消息:

When I run TensorFlow code in terminal (python 3 tfpractice.py), I get a longer than normal waiting time to get back output followed by these error messages:

W tensorflow/core/platform/cpu_feature_guard.cc:45] TensorFlow 库未编译为使用 SSE4.1 指令,但这些指令可在您的机器上使用,并且可以加速 CPU 计算.W tensorflow/core/platform/cpu_feature_guard.cc:45] TensorFlow 库未编译为使用 SSE4.2 指令,但这些指令可在您的机器上使用,并且可以加速 CPU 计算.W tensorflow/core/platform/cpu_feature_guard.cc:45] TensorFlow 库没有被编译为使用 AVX 指令,但这些在您的机器上可用并且可以加速 CPU 计算.W tensorflow/core/platform/cpu_feature_guard.cc:45] TensorFlow 库没有被编译为使用 AVX2 指令,但这些在您的机器上可用并且可以加速 CPU 计算.W tensorflow/core/platform/cpu_feature_guard.cc:45] TensorFlow 库未编译为使用 FMA 指令,但这些可在您的机器上使用并且可以加快 CPU 计算.

我不知道如何解决这个问题.我想让 TensorFlow 只在这个 pip3 安装上工作.所以我按照路径:tensorflow/core/platform/cpu_feature_guard

I have no clue how to fix this. I would like to get TensorFlow to just work on this pip3 install. So I followed the path to: tensorflow/core/platform/cpu_feature_guard

我需要在这里编辑代码吗?或者有没有其他方法可以让 TensorFlow 使用这些指令进行编译?

Do I need to edit the code here? Or is there an alternate way to get TensorFlow to compile with these instructions?

我使用 sudo pip3 install tensorflow 安装了 TensorFlow.

I installed TensorFlow using sudo pip3 install tensorflow.

推荐答案

注意 :这些不是错误消息,而只是警告消息.

NOTE : These are not error messages but mere warning messages.

最大化 TF 性能的最佳方法(除了编写好的代码!!),是从 来源

The best way to maximise TF performance (apart from writing good code !!), is to compile it from the sources

当您这样做时,TF 会要求您提供各种选项,其中也会涉及这些说明的选项.

When you do that, TF would ask you for a variety of options which will also involve options for these instructions.

根据我自己的经验,从源代码编译的平​​均性能更好.

In my own experience, compilation from the source is better in performance on an average.

如果您正在进行一些可以在 GPU 上完成的密集处理,那么这也可能解释了您的等待时间.对于 GPU 支持,您需要执行 pip3 install tensorflow-gpu

If you are doing some intensive processing that could be done on a GPU then that might also explain your waiting time. For GPU support you would need to do pip3 install tensorflow-gpu

这篇关于未使用 TensorFlow 编译的 CPU 指令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆