在Windows Anaconda 4.1.1 w Python 2.7中安装tensorflow。

时间:2022-04-06 20:23:47

I have followed the instructions in

我已经按照说明做了。

https://www.tensorflow.org/versions/r0.10/get_started/os_setup.html#anaconda-installation

https://www.tensorflow.org/versions/r0.10/get_started/os_setup.html anaconda-installation

activate tensorflow changes the environment as in the instructions

激活tensorflow会改变环境,就像在指令中一样。

but

conda install -c conda-forge tensorflow

conda安装-c conda-forge tensorflow。

gives me Using Anaconda Cloud api site https://api.anaconda.org Fetching package metadata ......... Solving package specifications: . Error: Package missing in current win-32 channels: - tensorflow

给我使用Anaconda Cloud api网站https://api.anaconda.org抓取包元数据解决包装规格:。错误:在当前win-32通道中丢失的包:- tensorflow。

Is there no way to install tensorflow in Windows?

在Windows中是否没有安装tensorflow的方法?

2 个解决方案

#1


2  

We just announced support for TensorFlow on Windows with the 0.12 release candidate. However, due to the vagaries of compiler versions on Windows, we only support Python 3.5 (see below for a fuller explanation).

我们刚刚宣布支持Windows上的TensorFlow和0.12候选版本。但是,由于Windows上的编译器版本的变化,我们只支持Python 3.5(请参阅下面以获得更完整的解释)。

At present there is no conda package for TensorFlow on Windows, but there is a pre-built PIP package in PyPI. If you install the 64-bit version of Python 3.5, either from Python.org or Anaconda, you can install TensorFlow with the following command (for the CPU-only version):

目前在Windows上没有对TensorFlow的conda包,但是PyPI中有一个预构建的PIP包。如果您安装了Python 3.5的64位版本,或者从Python.org或Anaconda中安装,您可以使用以下命令安装TensorFlow(只适用于cpuonly版本):

C:\> pip install tensorflow

If you have a GPU that supports CUDA 8.0, you can use the following command to install the GPU-accelerated version:

如果您有一个支持CUDA 8.0的GPU,您可以使用以下命令来安装GPU加速版本:

C:\> pip install tensorflow-gpu

Why does TensorFlow only support Python 3.5 on Windows? Python on Windows requires that you compile extensions using the same compiler as the one that was used to build the Python interpreter. The official distributions of Python 2.7 from Python.org and Anaconda were built with MSVC 9.0. We can't build TensorFlow with MSVC 9.0 (2008), because it relies on too many features from C++11, so we need to use MSVC 14.0 (2015). Only Python 3.5 on Windows was compiled with MSVC 14.0, so we are limited to supporting that version only.

为什么TensorFlow在Windows上只支持Python 3.5 ?Windows上的Python要求您使用与构建Python解释器所用的编译器相同的编译器来编译扩展。Python 2.7的官方发行版来自Python.org,而Anaconda是用MSVC 9.0构建的。我们不能使用MSVC 9.0(2008)构建TensorFlow,因为它依赖于c++ 11的太多特性,所以我们需要使用MSVC 14.0(2015)。只有在Windows上的Python 3.5是用MSVC 14.0编译的,所以我们只能支持那个版本。

#2


0  

Create a conda environment named tensorflow by invoking the following command: C:>conda create -n tensorflow

通过调用以下命令创建一个名为tensorflow的conda环境:C:>conda创建-n tensorflow。

Activate the conda environment by issuing the following command: C:> activate tensorflow (tensorflow)C:> # Your prompt should change

通过发出以下命令激活conda环境:C:>激活tensorflow (tensorflow)C:> #你的提示应该改变。

Issue the appropriate command to install TensorFlow inside your conda environment. To install the CPU-only version of TensorFlow, enter the following command:

发出适当的命令,在您的conda环境中安装TensorFlow。要安装只使用cpuonly版本的TensorFlow,请输入以下命令:

( To get 32- and 64-bit Windows binaries of many scientific open-source extension packages for the official CPython distribution of the Python programming language..... copy link https://www.lfd.uci.edu/~gohlke/pythonlibs/)

(为Python编程语言的官方CPython发行版提供许多科学开源扩展包的32位和64位Windows二进制文件)……复制链接https://www.lfd.uci.edu/ gohlke / pythonlibs /)

(tensorflow)C:> pip install — ignore-installed — upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.0.1-cp35-cp35m-win_amd64.whl

(tensorflow)C:> pip安装-忽略安装-升级https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.0.1-cp35- win_amd64.whl。

1) To install the GPU version of TensorFlow, enter the following command (on a single line):

1)安装GPU版本的TensorFlow,输入以下命令(单行):

(tensorflow)C:> pip install — ignore-installed — upgrade https://storage.googleapis.com/tensorflow/windows/gpu/tensorflow_gpu-1.0.1-cp35-cp35m-win_amd64.whl

(tensorflow)C:> pip安装-忽略安装-升级https://storage.googleapis.com/tensorflow/windows/gpu/tensorflow_gpu-1.0.1- cp35m-win_amd64.whl。

If you are using anaconda distribution and getting the above error, you can do the following to use python 3.5 on the new environnement “tensorflow”:

如果您正在使用anaconda分布并获得上述错误,您可以使用python 3.5在新环境“tensorflow”上使用以下方法:

conda create --name tensorflow python=3.5 activate tensorflow conda install jupyter conda install scipy pip install tensorflow or pip install tensorflow-gpu

conda创建-name tensorflow python=3.5激活tensorflow conda安装jupyter conda安装scipy pip安装tensorflow或pip安装tensorflow-gpu。

#1


2  

We just announced support for TensorFlow on Windows with the 0.12 release candidate. However, due to the vagaries of compiler versions on Windows, we only support Python 3.5 (see below for a fuller explanation).

我们刚刚宣布支持Windows上的TensorFlow和0.12候选版本。但是,由于Windows上的编译器版本的变化,我们只支持Python 3.5(请参阅下面以获得更完整的解释)。

At present there is no conda package for TensorFlow on Windows, but there is a pre-built PIP package in PyPI. If you install the 64-bit version of Python 3.5, either from Python.org or Anaconda, you can install TensorFlow with the following command (for the CPU-only version):

目前在Windows上没有对TensorFlow的conda包,但是PyPI中有一个预构建的PIP包。如果您安装了Python 3.5的64位版本,或者从Python.org或Anaconda中安装,您可以使用以下命令安装TensorFlow(只适用于cpuonly版本):

C:\> pip install tensorflow

If you have a GPU that supports CUDA 8.0, you can use the following command to install the GPU-accelerated version:

如果您有一个支持CUDA 8.0的GPU,您可以使用以下命令来安装GPU加速版本:

C:\> pip install tensorflow-gpu

Why does TensorFlow only support Python 3.5 on Windows? Python on Windows requires that you compile extensions using the same compiler as the one that was used to build the Python interpreter. The official distributions of Python 2.7 from Python.org and Anaconda were built with MSVC 9.0. We can't build TensorFlow with MSVC 9.0 (2008), because it relies on too many features from C++11, so we need to use MSVC 14.0 (2015). Only Python 3.5 on Windows was compiled with MSVC 14.0, so we are limited to supporting that version only.

为什么TensorFlow在Windows上只支持Python 3.5 ?Windows上的Python要求您使用与构建Python解释器所用的编译器相同的编译器来编译扩展。Python 2.7的官方发行版来自Python.org,而Anaconda是用MSVC 9.0构建的。我们不能使用MSVC 9.0(2008)构建TensorFlow,因为它依赖于c++ 11的太多特性,所以我们需要使用MSVC 14.0(2015)。只有在Windows上的Python 3.5是用MSVC 14.0编译的,所以我们只能支持那个版本。

#2


0  

Create a conda environment named tensorflow by invoking the following command: C:>conda create -n tensorflow

通过调用以下命令创建一个名为tensorflow的conda环境:C:>conda创建-n tensorflow。

Activate the conda environment by issuing the following command: C:> activate tensorflow (tensorflow)C:> # Your prompt should change

通过发出以下命令激活conda环境:C:>激活tensorflow (tensorflow)C:> #你的提示应该改变。

Issue the appropriate command to install TensorFlow inside your conda environment. To install the CPU-only version of TensorFlow, enter the following command:

发出适当的命令,在您的conda环境中安装TensorFlow。要安装只使用cpuonly版本的TensorFlow,请输入以下命令:

( To get 32- and 64-bit Windows binaries of many scientific open-source extension packages for the official CPython distribution of the Python programming language..... copy link https://www.lfd.uci.edu/~gohlke/pythonlibs/)

(为Python编程语言的官方CPython发行版提供许多科学开源扩展包的32位和64位Windows二进制文件)……复制链接https://www.lfd.uci.edu/ gohlke / pythonlibs /)

(tensorflow)C:> pip install — ignore-installed — upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.0.1-cp35-cp35m-win_amd64.whl

(tensorflow)C:> pip安装-忽略安装-升级https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.0.1-cp35- win_amd64.whl。

1) To install the GPU version of TensorFlow, enter the following command (on a single line):

1)安装GPU版本的TensorFlow,输入以下命令(单行):

(tensorflow)C:> pip install — ignore-installed — upgrade https://storage.googleapis.com/tensorflow/windows/gpu/tensorflow_gpu-1.0.1-cp35-cp35m-win_amd64.whl

(tensorflow)C:> pip安装-忽略安装-升级https://storage.googleapis.com/tensorflow/windows/gpu/tensorflow_gpu-1.0.1- cp35m-win_amd64.whl。

If you are using anaconda distribution and getting the above error, you can do the following to use python 3.5 on the new environnement “tensorflow”:

如果您正在使用anaconda分布并获得上述错误,您可以使用python 3.5在新环境“tensorflow”上使用以下方法:

conda create --name tensorflow python=3.5 activate tensorflow conda install jupyter conda install scipy pip install tensorflow or pip install tensorflow-gpu

conda创建-name tensorflow python=3.5激活tensorflow conda安装jupyter conda安装scipy pip安装tensorflow或pip安装tensorflow-gpu。