简体   繁体   English

TensorFlow 安装问题 Mac

[英]TensorFlow installation issue Mac

I recently started google's machine learning crash course.我最近开始了谷歌的机器学习速成课程。 However it didn't mention how to install TensorFlow, so I went to the website and followed the terminal instructions below for Mac.但是它没有提到如何安装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

This install step would return,此安装步骤将返回,

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)...要求已经是最新的:tensorflow in ./venv/lib/python3.7/site-packages (1.12.0) 要求已经满足,跳过升级:protobuf>=3.6.1 in ./venv/lib/python3。 7/site-packages(来自 tensorflow)(3.6.1)...

The next step was to test tensor flow in python,下一步是在 python 中测试张量流,

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

However, this would return,然而,这将返回,

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)运行时警告:模块 'tensorflow.python.framework.fast_tensor_util' 的编译时版本 3.6 与运行时版本 3.7 不匹配 return f(*args, **kwds) 2019-02-05 18:18:09.866187: I tensorflow/core/platform/ cpu_feature_guard.cc:141] 您的 CPU 支持此 TensorFlow 二进制文件未编译使用的指令:AVX2 FMA tf.Tensor(-1912.4221, shape=(), dtype=float32)

I've tried to install it outside of the virtual environment but would receive another error.我试图在虚拟环境之外安装它,但会收到另一个错误。

$ 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.找不到满足 tensorflow 要求的版本(来自版本:)未找到与 tensorflow 匹配的发行版 您正在使用 pip 版本 10.0.1,但是版本 19.0.1 可用。 You should consider upgrading via the 'pip install --upgrade pip' command.您应该考虑通过“pip install --upgrade pip”命令进行升级。

I've tried a few other variations I found online but still got the same errors.我尝试了一些我在网上找到的其他变体,但仍然遇到相同的错误。 The site I got the instructions on was, https://www.tensorflow.org/install/pip我得到说明的网站是, https://www.tensorflow.org/install/pip

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM