gpt4 book ai didi

python - TensorFlow安装问题Mac

转载 作者:行者123 更新时间:2023-12-01 08:22:21 25 4
gpt4 key购买 nike

我最近开始了谷歌的机器学习速成类(class)。但它没有提到如何安装 TensorFlow,因此我访问了该网站并按照下面的 Mac 终端说明进行操作。

$ virtualenv --system-site-packages -p python3 ./venv

$ source ./venv/bin/activate

(venv)$ pip install --upgrade pip

(venv)$ pip list

(venv)$ pip install --upgrade tensorflow

此安装步骤将返回,

Requirement already up-to-date: tensorflow in ./venv/lib/python3.7/site-packages (1.12.0) Requirement already satisfied, skipping upgrade: protobuf>=3.6.1 in ./venv/lib/python3.7/site-packages (from tensorflow) (3.6.1)...

下一步是在 python 中测试 tensorflow ,

(venv)$ python -c "import tensorflow as tf; tf.enable_eager_execution(); print(tf.reduce_sum(tf.random_normal([1000, 1000])))"

但是,这会返回,

RuntimeWarning: compiletime version 3.6 of module 'tensorflow.python.framework.fast_tensor_util' does not match runtime version 3.7 return f(*args, **kwds) 2019-02-05 18:18:09.866187: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA tf.Tensor(-1912.4221, shape=(), dtype=float32)

我尝试在虚拟环境之外安装它,但会收到另一个错误。

$ pip3 install --user --upgrade tensorflow

Could not find a version that satisfies the requirement tensorflow (from versions: ) No matching distribution found for tensorflow You are using pip version 10.0.1, however version 19.0.1 is available. You should consider upgrading via the 'pip install --upgrade pip' command.

我尝试了在网上找到的一些其他变体,但仍然遇到相同的错误。我收到说明的网站是 https://www.tensorflow.org/install/pip

最佳答案

Tensorflow 不适用于 Python 3.7,请改用 Python 3.6

关于python - TensorFlow安装问题Mac,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54542572/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com