Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/310.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 在Anaconda上安装特定版本的TensorFlow_Python_Tensorflow_Anaconda_Conda - Fatal编程技术网

Python 在Anaconda上安装特定版本的TensorFlow

Python 在Anaconda上安装特定版本的TensorFlow,python,tensorflow,anaconda,conda,Python,Tensorflow,Anaconda,Conda,TensorFlow有多个版本,如果我想在Anaconda中安装特定版本,我应该使用哪个命令?我假设您使用的是Windows、python3.5和TensorFlow的CPU版本 让我们首先创建conda环境 C:> conda create -n tensorflow python=3.5 C:> activate tensorflow (tensorflow)C:> # Your prompt should change 成功创建conda环境后,发出正确的命令以

TensorFlow有多个版本,如果我想在Anaconda中安装特定版本,我应该使用哪个命令?

我假设您使用的是Windows、python3.5和TensorFlow的CPU版本

让我们首先创建conda环境

C:> conda create -n tensorflow python=3.5 
C:> activate tensorflow
 (tensorflow)C:>  # Your prompt should change 
成功创建conda环境后,发出正确的命令以安装特定版本。我将指导您安装三个不同的版本

安装版本

安装版本

安装版本


让我知道这是否是您想要的

这可能是最简单的方法:

pip install --ignore-installed --upgrade tensorflow==1.4
如果要查看所有可用版本,可以签出


我强烈建议您使用
virtualenv
conda
隔离tensorflow安装,特别是如果您想测试不同版本和CPU/GPU版本。

我发现现有答案不令人满意,因为OP特别询问了Anaconda,但答案只是pip安装

您可以列出可用的安装版本

conda search tensorflow-gpu
这会给你一些输出,看起来像

Loading channels: done
# Name                       Version           Build  Channel             
tensorflow-gpu                 1.4.1               0  pkgs/main           
tensorflow-gpu                 1.5.0               0  pkgs/main           
tensorflow-gpu                 1.6.0               0  pkgs/main           
tensorflow-gpu                 1.7.0               0  pkgs/main           
tensorflow-gpu                 1.8.0      h7b35bdc_0  pkgs/main           
tensorflow-gpu                 1.9.0      hf154084_0  pkgs/main           
tensorflow-gpu                1.10.0      hf154084_0  pkgs/main           
tensorflow-gpu                1.11.0      h0d30ee6_0  pkgs/main           
tensorflow-gpu                1.12.0      h0d30ee6_0  pkgs/main           
tensorflow-gpu                1.13.1      h0d30ee6_0  pkgs/main           
tensorflow-gpu                1.14.0      h0d30ee6_0  pkgs/main           
tensorflow-gpu                1.15.0      h0d30ee6_0  pkgs/main           
tensorflow-gpu                 2.0.0      h0d30ee6_0  pkgs/main           
tensorflow-gpu                 2.1.0      h0d30ee6_0  pkgs/main           
tensorflow-gpu                 2.2.0      h0d30ee6_0  pkgs/main
如果需要指定特定频道,则
-c
/
--channel
选项是您的好友,例如:

conda search -c conda-forge tensorflow-gpu
conda install tensorflow-gpu==2.0.0
然后,您可以通过将其传递给install命令来选择您的版本,例如:

conda search -c conda-forge tensorflow-gpu
conda install tensorflow-gpu==2.0.0
如果在搜索中需要频道选项,则应将相同选项添加到
conda install
命令中。注意,对于
tensorflow
(即,不是GPU版本),这同样适用,只需相应地更改包名即可

YAML配置 如果使用YAML环境配置文件,则可以执行相同的操作:

# environment.yaml
name: my_conda_env
channels:
  - conda-forge
dependencies:
  - tensorflow-gpu=2.0.0
使用以下命令创建您的环境:

conda env create -f environment.yaml
或者,如果更改已创建环境的版本:

conda env update -f environment.yaml

您好-如何找到r1.7(py3.5)的控制盘。非常感谢。
conda env update -f environment.yaml