如何在Anaconda中重建TensorFlow?

问题描述 投票:0回答:1

运行 Keras 脚本时不断收到此错误:

        2024-02-10 14:11:47.255446: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations. To enable the following instructions: SSE4.1 SSE4.2 AVX AVX2 AVX_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.

我在互联网上找到了信息,我必须重建TensorFlow才能摆脱这个错误并加速我的程序。但是,我需要使用 Anaconda。如何从 Anaconda 重建 TensorFlow?

根据 https://www.tensorflow.org/install/source 的说明,我安装了重建它所需的所有内容,但我不确定应该将 TensorFlow 存储库放置在哪里。我也不知道命令应该如何匹配我的问题。重建 Tensorflow 文件以将其放入 Anaconda 后,我应该将其放置在哪里?

python tensorflow keras anaconda binary
1个回答
0
投票

在 Anaconda 中重建 TensorFlow 通常涉及创建新的 conda 环境并从源代码安装 TensorFlow。以下是一般步骤: 创建新的conda环境 :conda创建--名称 your_env_name python=3.x 康达激活 你的环境名称 安装必要的依赖项: conda 安装 numpy bazel 克隆 TensorFlow 存储库: git 克隆 https://github.com/tensorflow/tensorflow.git cd tensorflow 配置 TensorFlow build:./configure 按照提示设置配置选项。 构建 TensorFlow:bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package构建 pip package:bazel-bin/tensorflow/tools/pip_package/ build_pip_package /tmp/tensorflow_pkg安装重建的 TensorFlow:pip install /tmp/tensorflow_pkg/tensorflow-version-cp3x-cp3xm-linux_x86_64.whl将 your_env_name 替换为您所需的环境名称,将 3.x 替换为您首选的 Python 版本(例如 3.8)。另外,请确保您的系统上安装了必要的构建工具。

© www.soinside.com 2019 - 2024. All rights reserved.