linux ubuntu 16.04 python 3.5 cuda 9 pipを使用してpytorchをインストール


公式サイトの指導に従ってインストールしてもエラーが発生しますか? 
 
エラー:Could not find a version that satisfies the requirement torch==1.2.0+cu 92
$ sudo -H pip --proxy=xx.xxx.xx.xxx:8080 install torch==1.2.0+cu92 torchvision==0.4.0+cu92 -f https://download.pytorch.org/whl/torch_stable.html


#   :
Collecting torch==1.2.0+cu92
  Could not find a version that satisfies the requirement torch==1.2.0+cu92 (from versions: 0.1.2, 0.1.2.post1, 0.1.2.post2, 0.1.6.post17, 0.1.6.post20, 0.3.0.post4, 0.3.1, 0.4.0, 0.4.1, 1.0.0, 1.0.1, 1.0.1.post2, 1.1.0)
No matching distribution found for torch==1.2.0+cu92
You are using pip version 8.0.2, however version 19.2.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

原因:pipバージョンが間違っています!年を取った!私はpip 8をpip 19にアップグレードしてこの問題を解決しました.
解決:
# 1,  pip
$ sudo -H pip3 --proxy=xx.xxx.xx.xxx:8080 install --upgrade pip

#   :
Cache entry deserialization failed, entry ignored
Collecting pip
  Downloading https://files.pythonhosted.org/packages/30/db/9e38760b32e3e7f40cce46dd5fb107b8c73840df38f0046d8e6514e675a1/pip-19.2.3-py2.py3-none-any.whl (1.4MB)
    100% |▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒| 1.4MB 95kB/s
Installing collected packages: pip
  Found existing installation: pip 8.0.2
    Uninstalling pip-8.0.2:
      Successfully uninstalled pip-8.0.2
Successfully installed pip-19.2.3

# 2,         ,  pytorch
#   :https://pytorch.org/get-started/locally/
$ sudo -H pip3 --proxy=xx.xxx.xx.xxx:8080 install torch==1.2.0+cu92 torchvision==0.4.0+cu92 -f https://download.pytorch.org/whl/torch_stable.html

# 3,       :
$ python3
Python 3.5.2 (default, Nov 17 2016, 17:05:23)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> import torchvision
>>> torch.__version__
'1.2.0+cu92'
>>> torchvision.__version__
'0.4.0+cu92'

 
#その他のエラー:error:package directory'torch/cuda'does not exist
#        
$ sudo -H pip --proxy=xx.xxx.xx.xxx:8080 install torch torchvision cu90

#   
Collecting torch
  Using cached https://files.pythonhosted.org/packages/f8/02/880b468bd382dc79896eaecbeb8ce95e9c4b99a24902874a2cef0b562cea/torch-0.1.2.post2.tar.gz
    Complete output from command python setup.py egg_info:
    running egg_info
    creating pip-egg-info/torch.egg-info
    writing top-level names to pip-egg-info/torch.egg-info/top_level.txt
    writing pip-egg-info/torch.egg-info/PKG-INFO
    writing requirements to pip-egg-info/torch.egg-info/requires.txt
    writing dependency_links to pip-egg-info/torch.egg-info/dependency_links.txt
    writing manifest file 'pip-egg-info/torch.egg-info/SOURCES.txt'
    warning: manifest_maker: standard file '-c' not found

    error: package directory 'torch/cuda' does not exist

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-bsq0oe_b/torch
You are using pip version 8.0.2, however version 19.2.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

理由:pytorchは元々cudaを持っているわけではありません.公式サイトの指導に従ってインストールし、cuda付きpytorchバージョンを選択する必要があります.
解決:pipをアップグレードし、公式サイトで指導されたインストールコマンドを使用してインストールします.のように 
pip3 install torch==1.2.0+cu92 torchvision==0.4.0+cu92 -f https://download.pytorch.org/whl/torch_stable.html

(異なる環境に対応するインストールコマンドが異なる場合があります.タイトルに対応する環境では、上記のコマンドを使用すればいいです.xx.xxx.xxx.xxxは、イントラネットにエージェントが必要なため、インターネットを利用することができます.外部ネットでは、上記のコマンドを直接使用することができます)