conda 搭建 tf环境

(base) C:\Users\Administrator>conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/

(base) C:\Users\Administrator>conda config --set show_channel_urls yes

(base) C:\Users\Administrator>conda env list
# conda environments:
#
base                  *  D:\tool\Anoconda


(base) C:\Users\Administrator>conda search --full -name tensorflow
Loading channels: done
# Name                  Version           Build  Channel

tensorflow                1.9.0 eigen_py35hb0e21f4_1  pkgs/main
tensorflow                1.9.0 eigen_py36h0b764b7_1  pkgs/main
tensorflow                1.9.0 gpu_py35h0075c17_1  pkgs/main
tensorflow                1.9.0 gpu_py36hfdee9c2_1  pkgs/main
......

(base) C:\Users\Administrator>python
Python 3.6.5 |Anaconda, Inc.| (default, Mar 29 2018, 13:32:41) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()

(base) C:\Users\Administrator>conda info tensorflow


tensorflow 2.0.0 gpu_py36hfdd5754_0
-----------------------------------
file name   : tensorflow-2.0.0-gpu_py36hfdd5754_0.tar.bz2
name        : tensorflow
version     : 2.0.0
build string: gpu_py36hfdd5754_0
build number: 0
channel     : https://repo.anaconda.com/pkgs/main/win-64
size        : 4 KB
arch        : None
constrains  : ()
license     : Apache 2.0
license_family: Apache
md5         : ed53a2b4772fcb5bdda9509b48b12ef8
platform    : None
subdir      : win-64
timestamp   : 1571773244990
url         : https://repo.anaconda.com/pkgs/main/win-64/tensorflow-2.0.0-gpu_py36hfdd5754_0.tar.bz2
dependencies:
    _tflow_select 2.1.0 gpu
    python 3.6.*
    tensorboard >=2.0.0
    tensorflow-base 2.0.0 gpu_py36h390e234_0
    tensorflow-estimator >=2.0.0

(base) C:\Users\Administrator>conda create --name tf_env python=3.6
Solving environment: done


==> WARNING: A newer version of conda exists. <==
  current version: 4.5.4
  latest version: 4.7.12

Please update conda by running

    $ conda update -n base conda


## Package Plan ##

  environment location: D:\tool\Anoconda\envs\tf_env

  added / updated specs:
    - python=3.6

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    wincertstore-0.2           |           py36_0          14 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
    vs2015_runtime-14.0.25420  |                0         2.0 MB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
    python-3.6.2               |                0        31.5 MB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
    vc-14                      |                0          703 B  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
    certifi-2016.2.28          |           py36_0         214 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
    wheel-0.29.0               |           py36_0         129 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
    pip-9.0.1                  |           py36_1         1.7 MB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
    setuptools-36.4.0          |           py36_1         534 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
    ------------------------------------------------------------
                                           Total:        36.0 MB

The following NEW packages will be INSTALLED:

    certifi:        2016.2.28-py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
    pip:            9.0.1-py36_1     https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
    python:         3.6.2-0          https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
    setuptools:     36.4.0-py36_1    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
    vc:             14-0             https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
    vs2015_runtime: 14.0.25420-0     https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
    wheel:          0.29.0-py36_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
    wincertstore:   0.2-py36_0       https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free

Proceed ([y]/n)? y


Downloading and Extracting Packages
wincertstore-0.2     |   14 KB | ########################################################################### | 100%
vs2015_runtime-14.0. |  2.0 MB | ########################################################################### | 100%
python-3.6.2         | 31.5 MB | ########################################################################### | 100%
vc-14                |   703 B | ########################################################################### | 100%
certifi-2016.2.28    |  214 KB | ############################################################################## | 100%
wheel-0.29.0         |  129 KB | ############################################################################## | 100%
pip-9.0.1            |  1.7 MB | #############################################################################4 |  99pip-9.0.1            |  1.7 MB | ############################################################################## | 100%
setuptools-36.4.0    |  534 KB | ########################################################################### | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
#     $ conda activate tf_env
#
# To deactivate an active environment, use
#
#     $ conda deactivate


(base) C:\Users\Administrator>
(base) C:\Users\Administrator>conda activate tf_env

(tf_env) C:\Users\Administrator>conda deactivate

(base) C:\Users\Administrator>activate tensorflow
Could not find conda environment: tensorflow
You can list all discoverable environments with `conda info --envs`.


(base) C:\Users\Administrator>conda activate tf_env

(tf_env) C:\Users\Administrator>pip install tensorflow==1.10.0 -i https://pypi.tuna.tsinghua.edu.cn/simple/
Collecting tensorflow==1.10.0
  Cache entry deserialization failed, entry ignored
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/0e/2a/c3fe6035f0a8726e5b210680af3ccaf826f4a64ce7306e57017aba749447/tensorflow-1.10.0-cp36-cp36m-win_amd64.whl (37.7MB)
    100% |████████████████████████████████| 37.7MB 9.8kB/s
Collecting gast>=0.2.0 (from tensorflow==1.10.0)
  Cache entry deserialization failed, entry ignored
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/1f/04/4e36c33f8eb5c5b6c622a1f4859352a6acca7ab387257d4b3c191d23ec1d/gast-0.3.2.tar.gz
Collecting protobuf>=3.6.0 (from tensorflow==1.10.0)
  Cache entry deserialization failed, entry ignored
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/2d/73/4a14606fa26f186e23015bc974f9010e2bbf1607f372e3bd5e82d2a62f1b/protobuf-3.10.0-cp36-cp36m-win_amd64.whl (1.1MB)
    100% |████████████████████████████████| 1.1MB 204kB/s
Collecting six>=1.10.0 (from tensorflow==1.10.0)
  Cache entry deserialization failed, entry ignored
  Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.tuna.tsinghua.edu.cn', port=443): Read timed out. (read timeout=15)",)': /simple/six/
  Cache entry deserialization failed, entry ignored
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/65/26/32b8464df2a97e6dd1b656ed26b2c194606c16fe163c695a992b36c11cdf/six-1.13.0-py2.py3-none-any.whl
Collecting termcolor>=1.1.0 (from tensorflow==1.10.0)
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/8a/48/a76be51647d0eb9f10e2a4511bf3ffb8cc1e6b14e9e4fab46173aa79f981/termcolor-1.1.0.tar.gz
Collecting grpcio>=1.8.6 (from tensorflow==1.10.0)
  Cache entry deserialization failed, entry ignored
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/03/7d/5a51d7116a0f5a3a916148ed495698bfb6800868f0f60b0af55cb8353e84/grpcio-1.25.0-cp36-cp36m-win_amd64.whl (1.9MB)
    100% |████████████████████████████████| 1.9MB 133kB/s
Collecting absl-py>=0.1.6 (from tensorflow==1.10.0)
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/3b/72/e6e483e2db953c11efa44ee21c5fdb6505c4dffa447b4263ca8af6676b62/absl-py-0.8.1.tar.gz (103kB)
    100% |████████████████████████████████| 112kB 1.2MB/s
Collecting astor>=0.6.0 (from tensorflow==1.10.0)
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/d1/4f/950dfae467b384fc96bc6469de25d832534f6b4441033c39f914efd13418/astor-0.8.0-py2.py3-none-any.whl
Requirement already satisfied: wheel>=0.26 in d:\tool\anoconda\envs\tf_env\lib\site-packages (from tensorflow==1.10.0)
Requirement already satisfied: setuptools<=39.1.0 in d:\tool\anoconda\envs\tf_env\lib\site-packages (from tensorflow==1.10.0)
Collecting numpy<=1.14.5,>=1.13.3 (from tensorflow==1.10.0)
  Cache entry deserialization failed, entry ignored
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/0d/b7/0c804e0bcba6505f8392d042d5e333a5e06f308e019517111fbc7767a0bc/numpy-1.14.5-cp36-none-win_amd64.whl (13.4MB)
    100% |████████████████████████████████| 13.4MB 37kB/s
Collecting tensorboard<1.11.0,>=1.10.0 (from tensorflow==1.10.0)
  Cache entry deserialization failed, entry ignored
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/c6/17/ecd918a004f297955c30b4fffbea100b1606c225dbf0443264012773c3ff/tensorboard-1.10.0-py3-none-any.whl (3.3MB)
    100% |████████████████████████████████| 3.3MB 71kB/s
Collecting markdown>=2.6.8 (from tensorboard<1.11.0,>=1.10.0->tensorflow==1.10.0)
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/c0/4e/fd492e91abdc2d2fcb70ef453064d980688762079397f779758e055f6575/Markdown-3.1.1-py2.py3-none-any.whl (87kB)
    100% |████████████████████████████████| 92kB 1.1MB/s
Collecting werkzeug>=0.11.10 (from tensorboard<1.11.0,>=1.10.0->tensorflow==1.10.0)
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/ce/42/3aeda98f96e85fd26180534d36570e4d18108d62ae36f87694b476b83d6f/Werkzeug-0.16.0-py2.py3-none-any.whl (327kB)
    100% |████████████████████████████████| 327kB 556kB/s
Building wheels for collected packages: gast, termcolor, absl-py
  Running setup.py bdist_wheel for gast ... done
  Stored in directory: C:\Users\Administrator\AppData\Local\pip\Cache\wheels\c2\6a\97\8c1d91bb936dc6917205f2a4e22af5ab86fab933de96d5ff26
  Running setup.py bdist_wheel for termcolor ... done
  Stored in directory: C:\Users\Administrator\AppData\Local\pip\Cache\wheels\2f\92\65\6ea67d77a7758e30316513984c98397217b478edb328d1c1e2
  Running setup.py bdist_wheel for absl-py ... done
  Stored in directory: C:\Users\Administrator\AppData\Local\pip\Cache\wheels\90\f8\ee\9ed4f33803e4505950a3f91a1e64d6a6da6d6c8939ba2cf48f
Successfully built gast termcolor absl-py
Installing collected packages: gast, six, protobuf, termcolor, grpcio, absl-py, astor, numpy, markdown, werkzeug, tensorboard, tensorflow
Successfully installed absl-py-0.8.1 astor-0.8.0 gast-0.3.2 grpcio-1.25.0 markdown-3.1.1 numpy-1.14.5 protobuf-3.10.0 six-1.13.0 tensorboard-1.10.0 tensorflow-1.10.0 termcolor-1.1.0 werkzeug-0.16.0
You are using pip version 9.0.1, however version 19.3.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

(tf_env) C:\Users\Administrator>
(tf_env) C:\Users\Administrator>python -m pip install --upgrade pip
Cache entry deserialization failed, entry ignored
Collecting pip
  Downloading https://files.pythonhosted.org/packages/00/b6/9cfa56b4081ad13874b0c6f96af8ce16cfbc1cb06bedf8e9164ce5551ec1/pip-19.3.1-py2.py3-none-any.whl (1.4MB)
    100% |████████████████████████████████| 1.4MB 43kB/s
Installing collected packages: pip
  Found existing installation: pip 9.0.1
    Uninstalling pip-9.0.1:
      Successfully uninstalled pip-9.0.1
Successfully installed pip-19.3.1

(tf_env) C:\Users\Administrator>python
Python 3.6.2 |Continuum Analytics, Inc.| (default, Jul 20 2017, 12:30:02) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> tf.__version__
'1.10.0'
>>> exit(0
... exit()
  File "<stdin>", line 2
    exit()
       ^
SyntaxError: invalid syntax
>>> exit()
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
搭建tf-gpu环境,首先需要确保你的机器上有合适的GPU设备。接下来,你需要按照以下步骤进行操作: 1. 安装CUDA和cuDNN:CUDA是NVIDIA开发的并行计算平台,而cuDNN是一个加速深度神经网络的库。你需要根据你的GPU型号和操作系统版本选择合适的CUDA和cuDNN版本,并按照官方文档的指引进行安装。 2. 安装Anaconda:Anaconda是一个常用的Python发行版,它包含了很多科学计算和机器学习相关的包。你可以从Anaconda官方网站下载适合你的操作系统的安装包,并按照官方指引进行安装。 3. 创建虚拟环境:打开终端或命令行窗口,输入以下命令创建一个名为tf-gpu的虚拟环境,并指定Python版本为3.8: ``` conda create -n tf-gpu python=3.8 ``` 4. 激活虚拟环境:输入以下命令激活tf-gpu环境: ``` conda activate tf-gpu ``` 5. 安装TensorFlow-GPU:在激活的虚拟环境下,输入以下命令安装TensorFlow-GPU: ``` pip install tensorflow-gpu ``` 6. 验证是否成功:在Python交互环境下,导入TensorFlow并执行以下代码验证是否成功安装了TensorFlow-GPU,并输出GPU的名称: ```python import tensorflow as tf print(tf.test.is_gpu_available()) print(tf.test.gpu_device_name()) ``` 如果输出结果为True,并显示了GPU的名称,则说明tf-gpu环境搭建成功了。 请注意,以上步骤中的具体命令和操作可能会因为操作系统版本和环境配置的不同而略有差异。建议你参考TensorFlow和Anaconda的官方文档以确保正确安装和配置。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* [【DL】搭建属于自己的GPU深度学习环境](https://blog.csdn.net/weixin_47274607/article/details/122381473)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *3* [手把手教你搭建属于自己的GPU深度学习环境](https://blog.csdn.net/qq_28053421/article/details/117875784)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值