大服务器 pytorch环境配置
大服务器 pytorch环境配置
1、conda create -n wind_torch_2022 python==3.7
(base) bim@bim-PowerEdge-R730:~$ (base) bim@bim-PowerEdge-R730:~$ conda create -n wind_torch_2022 python==3.7 Solving environment: done ## Package Plan ## environment location: /home/bim/anaconda3/envs/wind_torch_2022 added / updated specs: - python==3.7 The following NEW packages will be INSTALLED: _libgcc_mutex: 0.1-main http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main ca-certificates: 2022.4.26-h06a4308_0 http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main certifi: 2021.10.8-py37h06a4308_2 http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main libedit: 3.1.20210910-h7f8727e_0 http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main libffi: 3.2.1-1 http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free libgcc-ng: 9.1.0-hdf63c60_0 http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main libstdcxx-ng: 9.1.0-hdf63c60_0 http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main ncurses: 6.3-h7f8727e_2 http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main openssl: 1.0.2u-h7b6447c_0 http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main pip: 21.2.2-py37h06a4308_0 http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main python: 3.7.0-h6e4f718_3 http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main readline: 7.0-h7b6447c_5 http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main setuptools: 61.2.0-py37h06a4308_0 http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main sqlite: 3.33.0-h62c20be_0 http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main tk: 8.6.11-h1ccaba5_0 http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main wheel: 0.37.1-pyhd3eb1b0_0 http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main xz: 5.2.5-h7f8727e_1 http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main zlib: 1.2.11-0 http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free Proceed ([y]/n)? y Preparing transaction: done Verifying transaction: done Executing transaction: done # # To activate this environment, use # # $ conda activate wind_torch_2022 # # To deactivate an active environment, use # # $ conda deactivate (base) bim@bim-PowerEdge-R730:~$ (base) bim@bim-PowerEdge-R730:~$ (base) bim@bim-PowerEdge-R730:~$ (base) bim@bim-PowerEdge-R730:~$
2、conda activate wind_torch_2022
3、pip install --pre torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/cu113
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
(wind_torch_2022) bim@bim-PowerEdge-R730:~$ (wind_torch_2022) bim@bim-PowerEdge-R730:~$ (wind_torch_2022) bim@bim-PowerEdge-R730:~$ pip install --pre torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/cu113 Looking in indexes: https://pypi.org/simple, https://download.pytorch.org/whl/nightly/cu113 Collecting torch Downloading https://download.pytorch.org/whl/nightly/cu113/torch-1.12.0.dev20220517%2Bcu113-cp37-cp37m-linux_x86_64.whl (2098.0 MB) |████████████████████████████████| 2098.0 MB 7.8 kB/s Collecting torchvision Downloading https://download.pytorch.org/whl/nightly/cu113/torchvision-0.13.0.dev20220517%2Bcu113-cp37-cp37m-linux_x86_64.whl (23.5 MB) |████████████████████████████████| 23.5 MB 655 kB/s Collecting torchaudio Downloading https://download.pytorch.org/whl/nightly/cu113/torchaudio-0.12.0.dev20220517%2Bcu113-cp37-cp37m-linux_x86_64.whl (3.7 MB) |████████████████████████████████| 3.7 MB 1.4 MB/s Collecting typing-extensions Using cached typing_extensions-4.2.0-py3-none-any.whl (24 kB) Collecting requests Using cached requests-2.27.1-py2.py3-none-any.whl (63 kB) Collecting numpy Using cached numpy-1.21.6-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (15.7 MB) Collecting pillow!=8.3.*,>=5.3.0 Using cached Pillow-9.1.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.1 MB) Collecting charset-normalizer~=2.0.0 Using cached charset_normalizer-2.0.12-py3-none-any.whl (39 kB) Requirement already satisfied: certifi>=2017.4.17 in ./anaconda3/envs/wind_torch_2022/lib/python3.7/site-packages (from requests->torchvision) (2021.10.8) Collecting idna<4,>=2.5 Using cached idna-3.3-py3-none-any.whl (61 kB) Collecting urllib3<1.27,>=1.21.1 Using cached urllib3-1.26.9-py2.py3-none-any.whl (138 kB) Installing collected packages: urllib3, typing-extensions, idna, charset-normalizer, torch, requests, pillow, numpy, torchvision, torchaudio Successfully installed charset-normalizer-2.0.12 idna-3.3 numpy-1.21.6 pillow-9.1.1 requests-2.27.1 torch-1.12.0.dev20220517+cu113 torchaudio-0.12.0.dev20220517+cu113 torchvision-0.13.0.dev20220517+cu113 typing-extensions-4.2.0 urllib3-1.26.9 (wind_torch_2022) bim@bim-PowerEdge-R730:~$
测试
(wind_torch_2022) bim@bim-PowerEdge-R730:~$ python Python 3.7.0 (default, Oct 9 2018, 10:31:47) [GCC 7.3.0] :: Anaconda, Inc. on linux Type "help", "copyright", "credits" or "license" for more information. >>> >>> import torch >>> >>> x = torch.Tensor([1.0]) >>> >>> y = x.cuda() >>> >>> print(y) tensor([1.], device='cuda:0') >>> >>> exit(); (wind_torch_2022) bim@bim-PowerEdge-R730:~$
###################
QQ 3087438119