【问题标题】:Optimize Tensorflow image recognition on CPU [duplicate]在 CPU 上优化 Tensorflow 图像识别 [重复]
【发布时间】:2017-12-20 10:45:59
【问题描述】:

我想知道是否可以优化 Tensorflow (InceptionV.3) 的图像识别。事实上,我想在仅配备 VPS 的 CPU 上介绍后者。现在,我设法在 30-40 秒后得到结果,我想知道是否有解决方案可以减少这个时间:/(没有 GPU)

执行此代码时收到此警告:

2017-07-15 02: 40: 19.230276: W tensorflow / core / platform / cpu_feature_guard.cc: 45] The TensorFlow library was not compiled to use SSE4.1 instructions, but these are CPU computations.
2017-07-15 02: 40: 19.230359: W tensorflow / core / platform / cpu_feature_guard.cc: 45] The TensorFlow library was not compiled to use SSE4.2 instructions, but these are CPU computations.

你觉得这次编译会大大减少时间吗?我在他们的网站上没有找到任何提到这个警告的文件。 我是 Tensorflow 的新手,所以我什么都不懂... 我在 ubuntu 16.04 LTS,我使用 python 2.7.12

提前谢谢你! :)

【问题讨论】:

    标签: python performance tensorflow cpu


    【解决方案1】:

    您收到此警告是因为您的 CPU 具有 tensorflow 可以用来加快工作速度的功能,但您下载的“构建”不支持。解决方案是从源代码重建 tensorflow,是的,如果这是您收到的警告,它会在 99% 的时间内更快地为您工作。

    接收有关如何从源代码构建 tensorflow 的说明 - Check here

    运行bazel build 命令时,一定要使用--copt=-msse4.2 标志

    【讨论】:

    • 非常感谢您提供此信息 :) 我会立即按照网站上的说明进行操作,非常感谢 :)
    • 不要回答重复的问题。这已经被问过很多次了。只需标记为重复
    猜你喜欢
    • 2019-07-06
    • 1970-01-01
    • 1970-01-01
    • 2017-12-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-20
    • 2017-12-16
    相关资源
    最近更新 更多