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

查看:68
本文介绍了未使用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] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations. W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations. W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations. W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations. W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations.

W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations. W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations. W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations. W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations. W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations.

我不知道如何解决此问题.我想让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天全站免登陆