未使用TensorFlow编译的CPU指令

编程入门 行业动态 更新时间:2024-10-26 23:25:35
本文介绍了未使用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指令

本文发布于:2023-11-13 11:58:18,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1584297.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:指令   TensorFlow   CPU

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!