torch.hub.list(‘pytorch/vision‘)的安装记录

  1. 错误信息
    首先运行1_seg_demo.py ,然后要根据网址,下载了vision-master.zip,安装了,然后使用vision-master.zip。
torch_1.7.1_gpu) E:\PythonPRO\PytorchPro\G5>pip install vision-master.zip

出现下面结果:

Looking in indexes: https://mirrors.aliyun.com/pypi/simple
Processing e:\pythonpro\pytorchpro\g5\vision-master.zip
Requirement already satisfied: numpy in d:\programdata\anaconda3\envs\pytorch_1.7.1_gpu\lib\site-packages (from torchvision==0.10.0a0) (1.20.0)
Requirement already satisfied: torch in d:\programdata\anaconda3\envs\pytorch_1.7.1_gpu\lib\site-packages (from torchvision==0.10.0a0) (1.7.1+cu110)
Requirement already satisfied: pillow>=5.3.0 in d:\programdata\anaconda3\envs\pytorch_1.7.1_gpu\lib\site-packages (from torchvision==0.10.0a0) (8.1.0)
Requirement already satisfied: typing-extensions in d:\programdata\anaconda3\envs\pytorch_1.7.1_gpu\lib\site-packages (from torch->torchvision==0.10.0a0) (3.7.4.3)
Building wheels for collected packages: torchvision
  Building wheel for torchvision (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'D:\ProgramData\Anaconda3\envs\pytorch_1.7.1_gpu\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-req-build-wt2kc08a\\setup.py'"'"'; __file__='"'
"'C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-req-build-wt2kc08a\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '
"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\Administrator\AppData\Local\Temp\pip-wheel-t5uvjiim'
       cwd: C:\Users\Administrator\AppData\Local\Temp\pip-req-build-wt2kc08a\
  Complete output (141 lines):
  Building wheel torchvision-0.10.0a0
  PNG found: True
  Running build on conda-build: False
  Running build on conda: True
  JPEG found: False
  FFmpeg found: False
  running bdist_wheel
  D:\ProgramData\Anaconda3\envs\pytorch_1.7.1_gpu\lib\site-packages\torch\utils\cpp_extension.py:352: UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja.. Falling back to using the slow dis
tutils backend.
    warnings.warn(msg.format('we could not find ninja.'))
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.9
  creating build\lib.win-amd64-3.9\torchvision
  copying torchvision\extension.py -> build\lib.win-amd64-3.9\torchvision
  copying torchvision\utils.py -> build\lib.win-amd64-3.9\torchvision
  copying torchvision\version.py -> build\lib.win-amd64-3.9\torchvision
  copying torchvision\__init__.py -> build\lib.win-amd64-3.9\torchvision
  creating build\lib.win-amd64-3.9\torchvision\datasets
  copying torchvision\datasets\caltech.py -> build\lib.win-amd64-3.9\torchvision\datasets
  copying torchvision\datasets\celeba.py -> build\lib.win-amd64-3.9\torchvision\datasets
  copying torchvision\datasets\cifar.py -> build\lib.win-amd64-3.9\torchvision\datasets
  copying torchvision\datasets\cityscapes.py -> build\lib.win-amd64-3.9\torchvision\datasets
  copying torchvision\datasets\coco.py -> build\lib.win-amd64-3.9\torchvision\datasets
  copying torchvision\datasets\fakedata.py -> build\lib.win-amd64-3.9\torchvision\datasets
  copying torchvision\datasets\flickr.py -> build\lib.win-amd64-3.9\torchvision\datasets
  copying torchvision\datasets\folder.py -> build\lib.win-amd64-3.9\torchvision\datasets
  copying torchvision\datasets\hmdb51.py -> build\lib.win-amd64-3.9\torchvision\datasets
  copying torchvision\datasets\imagenet.py -> build\lib.win-amd64-3.9\torchvision\datasets
  copying torchvision\datasets\kinetics.py -> build\lib.win-amd64-3.9\torchvision\datasets
  copying torchvision\datasets\kitti.py -> build\lib.win-amd64-3.9\torchvision\datasets
  copying torchvision\datasets\lsun.py -> build\lib.win-amd64-3.9\torchvision\datasets
  copying torchvision\datasets\mnist.py -> build\lib.win-amd64-3.9\torchvision\datasets
  copying torchvision\datasets\omniglot.py -> build\lib.win-amd64-3.9\torchvision\datasets
  copying torchvision\datasets\phototour.py -> build\lib.win-amd64-3.9\torchvision\datasets
  copying torchvision\datasets\places365.py -> build\lib.win-amd64-3.9\torchvision\datasets
  copying torchvision\datasets\sbd.py -> build\lib.win-amd64-3.9\torchvision\datasets
  copying torchvision\datasets\sbu.py -> build\lib.win-amd64-3.9\torchvision\datasets
  copying torchvision\datasets\semeion.py -> build\lib.win-amd64-3.9\torchvision\datasets
  copying torchvision\datasets\stl10.py -> build\lib.win-amd64-3.9\torchvision\datasets
  copying torchvision\datasets\svhn.py -> build\lib.win-amd64-3.9\torchvision\datasets
  copying torchvision\datasets\ucf101.py -> build\lib.win-amd64-3.9\torchvision\datasets
  copying torchvision\datasets\usps.py -> build\lib.win-amd64-3.9\torchvision\datasets
  copying torchvision\datasets\utils.py -> build\lib.win-amd64-3.9\torchvision\datasets
  copying torchvision\datasets\video_utils.py -> build\lib.win-amd64-3.9\torchvision\datasets
  copying torchvision\datasets\vision.py -> build\lib.win-amd64-3.9\torchvision\datasets
  copying torchvision\datasets\voc.py -> build\lib.win-amd64-3.9\torchvision\datasets
  copying torchvision\datasets\widerface.py -> build\lib.win-amd64-3.9\torchvision\datasets
  copying torchvision\datasets\__init__.py -> build\lib.win-amd64-3.9\torchvision\datasets
  creating build\lib.win-amd64-3.9\torchvision\io
  copying torchvision\io\image.py -> build\lib.win-amd64-3.9\torchvision\io
  copying torchvision\io\video.py -> build\lib.win-amd64-3.9\torchvision\io
  copying torchvision\io\_video_opt.py -> build\lib.win-amd64-3.9\torchvision\io
  copying torchvision\io\__init__.py -> build\lib.win-amd64-3.9\torchvision\io
  creating build\lib.win-amd64-3.9\torchvision\models
  copying torchvision\models\alexnet.py -> build\lib.win-amd64-3.9\torchvision\models
  copying torchvision\models\densenet.py -> build\lib.win-amd64-3.9\torchvision\models
  copying torchvision\models\googlenet.py -> build\lib.win-amd64-3.9\torchvision\models
  copying torchvision\models\inception.py -> build\lib.win-amd64-3.9\torchvision\models
  copying torchvision\models\mnasnet.py -> build\lib.win-amd64-3.9\torchvision\models
  copying torchvision\models\mobilenet.py -> build\lib.win-amd64-3.9\torchvision\models
  copying torchvision\models\mobilenetv2.py -> build\lib.win-amd64-3.9\torchvision\models
  copying torchvision\models\mobilenetv3.py -> build\lib.win-amd64-3.9\torchvision\models
  copying torchvision\models\resnet.py -> build\lib.win-amd64-3.9\torchvision\models
  copying torchvision\models\shufflenetv2.py -> build\lib.win-amd64-3.9\torchvision\models
  copying torchvision\models\squeezenet.py -> build\lib.win-amd64-3.9\torchvision\models
  copying torchvision\models\utils.py -> build\lib.win-amd64-3.9\torchvision\models
  copying torchvision\models\vgg.py -> build\lib.win-amd64-3.9\torchvision\models
  copying torchvision\models\_utils.py -> build\lib.win-amd64-3.9\torchvision\models
  copying torchvision\models\__init__.py -> build\lib.win-amd64-3.9\torchvision\models
  creating build\lib.win-amd64-3.9\torchvision\ops
  copying torchvision\ops\boxes.py -> build\lib.win-amd64-3.9\torchvision\ops
  copying torchvision\ops\deform_conv.py -> build\lib.win-amd64-3.9\torchvision\ops
  copying torchvision\ops\feature_pyramid_network.py -> build\lib.win-amd64-3.9\torchvision\ops
  copying torchvision\ops\focal_loss.py -> build\lib.win-amd64-3.9\torchvision\ops
  copying torchvision\ops\misc.py -> build\lib.win-amd64-3.9\torchvision\ops
  copying torchvision\ops\poolers.py -> build\lib.win-amd64-3.9\torchvision\ops
  copying torchvision\ops\ps_roi_align.py -> build\lib.win-amd64-3.9\torchvision\ops
  copying torchvision\ops\ps_roi_pool.py -> build\lib.win-amd64-3.9\torchvision\ops
  copying torchvision\ops\roi_align.py -> build\lib.win-amd64-3.9\torchvision\ops
  copying torchvision\ops\roi_pool.py -> build\lib.win-amd64-3.9\torchvision\ops
  copying torchvision\ops\_box_convert.py -> build\lib.win-amd64-3.9\torchvision\ops
  copying torchvision\ops\_register_onnx_ops.py -> build\lib.win-amd64-3.9\torchvision\ops
  copying torchvision\ops\_utils.py -> build\lib.win-amd64-3.9\torchvision\ops
  copying torchvision\ops\__init__.py -> build\lib.win-amd64-3.9\torchvision\ops
  creating build\lib.win-amd64-3.9\torchvision\transforms
  copying torchvision\transforms\autoaugment.py -> build\lib.win-amd64-3.9\torchvision\transforms
  copying torchvision\transforms\functional.py -> build\lib.win-amd64-3.9\torchvision\transforms
  copying torchvision\transforms\functional_pil.py -> build\lib.win-amd64-3.9\torchvision\transforms
  copying torchvision\transforms\functional_tensor.py -> build\lib.win-amd64-3.9\torchvision\transforms
  copying torchvision\transforms\transforms.py -> build\lib.win-amd64-3.9\torchvision\transforms
  copying torchvision\transforms\_functional_video.py -> build\lib.win-amd64-3.9\torchvision\transforms
  copying torchvision\transforms\_transforms_video.py -> build\lib.win-amd64-3.9\torchvision\transforms
  copying torchvision\transforms\__init__.py -> build\lib.win-amd64-3.9\torchvision\transforms
  creating build\lib.win-amd64-3.9\torchvision\datasets\samplers
  copying torchvision\datasets\samplers\clip_sampler.py -> build\lib.win-amd64-3.9\torchvision\datasets\samplers
  copying torchvision\datasets\samplers\__init__.py -> build\lib.win-amd64-3.9\torchvision\datasets\samplers
  creating build\lib.win-amd64-3.9\torchvision\models\detection
  copying torchvision\models\detection\anchor_utils.py -> build\lib.win-amd64-3.9\torchvision\models\detection
  copying torchvision\models\detection\backbone_utils.py -> build\lib.win-amd64-3.9\torchvision\models\detection
  copying torchvision\models\detection\faster_rcnn.py -> build\lib.win-amd64-3.9\torchvision\models\detection
  copying torchvision\models\detection\generalized_rcnn.py -> build\lib.win-amd64-3.9\torchvision\models\detection
  copying torchvision\models\detection\image_list.py -> build\lib.win-amd64-3.9\torchvision\models\detection
  copying torchvision\models\detection\keypoint_rcnn.py -> build\lib.win-amd64-3.9\torchvision\models\detection
  copying torchvision\models\detection\mask_rcnn.py -> build\lib.win-amd64-3.9\torchvision\models\detection
  copying torchvision\models\detection\retinanet.py -> build\lib.win-amd64-3.9\torchvision\models\detection
  copying torchvision\models\detection\roi_heads.py -> build\lib.win-amd64-3.9\torchvision\models\detection
  copying torchvision\models\detection\rpn.py -> build\lib.win-amd64-3.9\torchvision\models\detection
  copying torchvision\models\detection\transform.py -> build\lib.win-amd64-3.9\torchvision\models\detection
  copying torchvision\models\detection\_utils.py -> build\lib.win-amd64-3.9\torchvision\models\detection
  copying torchvision\models\detection\__init__.py -> build\lib.win-amd64-3.9\torchvision\models\detection
  creating build\lib.win-amd64-3.9\torchvision\models\quantization
  copying torchvision\models\quantization\googlenet.py -> build\lib.win-amd64-3.9\torchvision\models\quantization
  copying torchvision\models\quantization\inception.py -> build\lib.win-amd64-3.9\torchvision\models\quantization
  copying torchvision\models\quantization\mobilenet.py -> build\lib.win-amd64-3.9\torchvision\models\quantization
  copying torchvision\models\quantization\mobilenetv2.py -> build\lib.win-amd64-3.9\torchvision\models\quantization
  copying torchvision\models\quantization\mobilenetv3.py -> build\lib.win-amd64-3.9\torchvision\models\quantization
  copying torchvision\models\quantization\resnet.py -> build\lib.win-amd64-3.9\torchvision\models\quantization
  copying torchvision\models\quantization\shufflenetv2.py -> build\lib.win-amd64-3.9\torchvision\models\quantization
  copying torchvision\models\quantization\utils.py -> build\lib.win-amd64-3.9\torchvision\models\quantization
  copying torchvision\models\quantization\__init__.py -> build\lib.win-amd64-3.9\torchvision\models\quantization
  creating build\lib.win-amd64-3.9\torchvision\models\segmentation
  copying torchvision\models\segmentation\deeplabv3.py -> build\lib.win-amd64-3.9\torchvision\models\segmentation
  copying torchvision\models\segmentation\fcn.py -> build\lib.win-amd64-3.9\torchvision\models\segmentation
  copying torchvision\models\segmentation\lraspp.py -> build\lib.win-amd64-3.9\torchvision\models\segmentation
  copying torchvision\models\segmentation\segmentation.py -> build\lib.win-amd64-3.9\torchvision\models\segmentation
  copying torchvision\models\segmentation\_utils.py -> build\lib.win-amd64-3.9\torchvision\models\segmentation
  copying torchvision\models\segmentation\__init__.py -> build\lib.win-amd64-3.9\torchvision\models\segmentation
  creating build\lib.win-amd64-3.9\torchvision\models\video
  copying torchvision\models\video\resnet.py -> build\lib.win-amd64-3.9\torchvision\models\video
  copying torchvision\models\video\__init__.py -> build\lib.win-amd64-3.9\torchvision\models\video
  running build_ext
  D:\ProgramData\Anaconda3\envs\pytorch_1.7.1_gpu\lib\site-packages\torch\utils\cpp_extension.py:287: UserWarning: Error checking compiler version for cl: [WinError 2] 系统找不到指定的文件。
    warnings.warn('Error checking compiler version for {}: {}'.format(compiler, error))
  building 'torchvision._C' extension
  error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
  Error in atexit._run_exitfuncs:
  Traceback (most recent call last):
    File "D:\ProgramData\Anaconda3\envs\pytorch_1.7.1_gpu\lib\site-packages\colorama\ansitowin32.py", line 59, in closed
      return stream.closed
  ValueError: underlying buffer has been detached
  ----------------------------------------
  ERROR: Failed building wheel for torchvision
  Running setup.py clean for torchvision
Failed to build torchvision
Installing collected packages: torchvision
  Attempting uninstall: torchvision
    Found existing installation: torchvision 0.8.2+cu110
    Uninstalling torchvision-0.8.2+cu110:
      Successfully uninstalled torchvision-0.8.2+cu110
    Running setup.py install for torchvision ... error
    ERROR: Command errored out with exit status 1:
     command: 'D:\ProgramData\Anaconda3\envs\pytorch_1.7.1_gpu\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-req-build-wt2kc08a\\setup.py'"'"'; __file__='
"'"'C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-req-build-wt2kc08a\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__,
 '"'"'exec'"'"'))' install --record 'C:\Users\Administrator\AppData\Local\Temp\pip-record-nj0p9knr\install-record.txt' --single-version-externally-managed --compile --install-headers 'D:\ProgramData\Anaconda3\envs\pytorch_1.7.1_gpu\
Include\torchvision'
         cwd: C:\Users\Administrator\AppData\Local\Temp\pip-req-build-wt2kc08a\
    Complete output (141 lines):
    Building wheel torchvision-0.10.0a0
    PNG found: True
    Running build on conda-build: False
    Running build on conda: True
    JPEG found: False
    FFmpeg found: False
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.9
    creating build\lib.win-amd64-3.9\torchvision
    copying torchvision\extension.py -> build\lib.win-amd64-3.9\torchvision
    copying torchvision\utils.py -> build\lib.win-amd64-3.9\torchvision
    copying torchvision\version.py -> build\lib.win-amd64-3.9\torchvision
    copying torchvision\__init__.py -> build\lib.win-amd64-3.9\torchvision
    creating build\lib.win-amd64-3.9\torchvision\datasets
    copying torchvision\datasets\caltech.py -> build\lib.win-amd64-3.9\torchvision\datasets
    copying torchvision\datasets\celeba.py -> build\lib.win-amd64-3.9\torchvision\datasets
    copying torchvision\datasets\cifar.py -> build\lib.win-amd64-3.9\torchvision\datasets
    copying torchvision\datasets\cityscapes.py -> build\lib.win-amd64-3.9\torchvision\datasets
    copying torchvision\datasets\coco.py -> build\lib.win-amd64-3.9\torchvision\datasets
    copying torchvision\datasets\fakedata.py -> build\lib.win-amd64-3.9\torchvision\datasets
    copying torchvision\datasets\flickr.py -> build\lib.win-amd64-3.9\torchvision\datasets
    copying torchvision\datasets\folder.py -> build\lib.win-amd64-3.9\torchvision\datasets
    copying torchvision\datasets\hmdb51.py -> build\lib.win-amd64-3.9\torchvision\datasets
    copying torchvision\datasets\imagenet.py -> build\lib.win-amd64-3.9\torchvision\datasets
    copying torchvision\datasets\kinetics.py -> build\lib.win-amd64-3.9\torchvision\datasets
    copying torchvision\datasets\kitti.py -> build\lib.win-amd64-3.9\torchvision\datasets
    copying torchvision\datasets\lsun.py -> build\lib.win-amd64-3.9\torchvision\datasets
    copying torchvision\datasets\mnist.py -> build\lib.win-amd64-3.9\torchvision\datasets
    copying torchvision\datasets\omniglot.py -> build\lib.win-amd64-3.9\torchvision\datasets
    copying torchvision\datasets\phototour.py -> build\lib.win-amd64-3.9\torchvision\datasets
    copying torchvision\datasets\places365.py -> build\lib.win-amd64-3.9\torchvision\datasets
    copying torchvision\datasets\sbd.py -> build\lib.win-amd64-3.9\torchvision\datasets
    copying torchvision\datasets\sbu.py -> build\lib.win-amd64-3.9\torchvision\datasets
    copying torchvision\datasets\semeion.py -> build\lib.win-amd64-3.9\torchvision\datasets
    copying torchvision\datasets\stl10.py -> build\lib.win-amd64-3.9\torchvision\datasets
    copying torchvision\datasets\svhn.py -> build\lib.win-amd64-3.9\torchvision\datasets
    copying torchvision\datasets\ucf101.py -> build\lib.win-amd64-3.9\torchvision\datasets
    copying torchvision\datasets\usps.py -> build\lib.win-amd64-3.9\torchvision\datasets
    copying torchvision\datasets\utils.py -> build\lib.win-amd64-3.9\torchvision\datasets
    copying torchvision\datasets\video_utils.py -> build\lib.win-amd64-3.9\torchvision\datasets
    copying torchvision\datasets\vision.py -> build\lib.win-amd64-3.9\torchvision\datasets
    copying torchvision\datasets\voc.py -> build\lib.win-amd64-3.9\torchvision\datasets
    copying torchvision\datasets\widerface.py -> build\lib.win-amd64-3.9\torchvision\datasets
    copying torchvision\datasets\__init__.py -> build\lib.win-amd64-3.9\torchvision\datasets
    creating build\lib.win-amd64-3.9\torchvision\io
    copying torchvision\io\image.py -> build\lib.win-amd64-3.9\torchvision\io
    copying torchvision\io\video.py -> build\lib.win-amd64-3.9\torchvision\io
    copying torchvision\io\_video_opt.py -> build\lib.win-amd64-3.9\torchvision\io
    copying torchvision\io\__init__.py -> build\lib.win-amd64-3.9\torchvision\io
    creating build\lib.win-amd64-3.9\torchvision\models
    copying torchvision\models\alexnet.py -> build\lib.win-amd64-3.9\torchvision\models
    copying torchvision\models\densenet.py -> build\lib.win-amd64-3.9\torchvision\models
    copying torchvision\models\googlenet.py -> build\lib.win-amd64-3.9\torchvision\models
    copying torchvision\models\inception.py -> build\lib.win-amd64-3.9\torchvision\models
    copying torchvision\models\mnasnet.py -> build\lib.win-amd64-3.9\torchvision\models
    copying torchvision\models\mobilenet.py -> build\lib.win-amd64-3.9\torchvision\models
    copying torchvision\models\mobilenetv2.py -> build\lib.win-amd64-3.9\torchvision\models
    copying torchvision\models\mobilenetv3.py -> build\lib.win-amd64-3.9\torchvision\models
    copying torchvision\models\resnet.py -> build\lib.win-amd64-3.9\torchvision\models
    copying torchvision\models\shufflenetv2.py -> build\lib.win-amd64-3.9\torchvision\models
    copying torchvision\models\squeezenet.py -> build\lib.win-amd64-3.9\torchvision\models
    copying torchvision\models\utils.py -> build\lib.win-amd64-3.9\torchvision\models
    copying torchvision\models\vgg.py -> build\lib.win-amd64-3.9\torchvision\models
    copying torchvision\models\_utils.py -> build\lib.win-amd64-3.9\torchvision\models
    copying torchvision\models\__init__.py -> build\lib.win-amd64-3.9\torchvision\models
    creating build\lib.win-amd64-3.9\torchvision\ops
    copying torchvision\ops\boxes.py -> build\lib.win-amd64-3.9\torchvision\ops
    copying torchvision\ops\deform_conv.py -> build\lib.win-amd64-3.9\torchvision\ops
    copying torchvision\ops\feature_pyramid_network.py -> build\lib.win-amd64-3.9\torchvision\ops
    copying torchvision\ops\focal_loss.py -> build\lib.win-amd64-3.9\torchvision\ops
    copying torchvision\ops\misc.py -> build\lib.win-amd64-3.9\torchvision\ops
    copying torchvision\ops\poolers.py -> build\lib.win-amd64-3.9\torchvision\ops
    copying torchvision\ops\ps_roi_align.py -> build\lib.win-amd64-3.9\torchvision\ops
    copying torchvision\ops\ps_roi_pool.py -> build\lib.win-amd64-3.9\torchvision\ops
    copying torchvision\ops\roi_align.py -> build\lib.win-amd64-3.9\torchvision\ops
    copying torchvision\ops\roi_pool.py -> build\lib.win-amd64-3.9\torchvision\ops
    copying torchvision\ops\_box_convert.py -> build\lib.win-amd64-3.9\torchvision\ops
    copying torchvision\ops\_register_onnx_ops.py -> build\lib.win-amd64-3.9\torchvision\ops
    copying torchvision\ops\_utils.py -> build\lib.win-amd64-3.9\torchvision\ops
    copying torchvision\ops\__init__.py -> build\lib.win-amd64-3.9\torchvision\ops
    creating build\lib.win-amd64-3.9\torchvision\transforms
    copying torchvision\transforms\autoaugment.py -> build\lib.win-amd64-3.9\torchvision\transforms
    copying torchvision\transforms\functional.py -> build\lib.win-amd64-3.9\torchvision\transforms
    copying torchvision\transforms\functional_pil.py -> build\lib.win-amd64-3.9\torchvision\transforms
    copying torchvision\transforms\functional_tensor.py -> build\lib.win-amd64-3.9\torchvision\transforms
    copying torchvision\transforms\transforms.py -> build\lib.win-amd64-3.9\torchvision\transforms
    copying torchvision\transforms\_functional_video.py -> build\lib.win-amd64-3.9\torchvision\transforms
    copying torchvision\transforms\_transforms_video.py -> build\lib.win-amd64-3.9\torchvision\transforms
    copying torchvision\transforms\__init__.py -> build\lib.win-amd64-3.9\torchvision\transforms
    creating build\lib.win-amd64-3.9\torchvision\datasets\samplers
    copying torchvision\datasets\samplers\clip_sampler.py -> build\lib.win-amd64-3.9\torchvision\datasets\samplers
    copying torchvision\datasets\samplers\__init__.py -> build\lib.win-amd64-3.9\torchvision\datasets\samplers
    creating build\lib.win-amd64-3.9\torchvision\models\detection
    copying torchvision\models\detection\anchor_utils.py -> build\lib.win-amd64-3.9\torchvision\models\detection
    copying torchvision\models\detection\backbone_utils.py -> build\lib.win-amd64-3.9\torchvision\models\detection
    copying torchvision\models\detection\faster_rcnn.py -> build\lib.win-amd64-3.9\torchvision\models\detection
    copying torchvision\models\detection\generalized_rcnn.py -> build\lib.win-amd64-3.9\torchvision\models\detection
    copying torchvision\models\detection\image_list.py -> build\lib.win-amd64-3.9\torchvision\models\detection
    copying torchvision\models\detection\keypoint_rcnn.py -> build\lib.win-amd64-3.9\torchvision\models\detection
    copying torchvision\models\detection\mask_rcnn.py -> build\lib.win-amd64-3.9\torchvision\models\detection
    copying torchvision\models\detection\retinanet.py -> build\lib.win-amd64-3.9\torchvision\models\detection
    copying torchvision\models\detection\roi_heads.py -> build\lib.win-amd64-3.9\torchvision\models\detection
    copying torchvision\models\detection\rpn.py -> build\lib.win-amd64-3.9\torchvision\models\detection
    copying torchvision\models\detection\transform.py -> build\lib.win-amd64-3.9\torchvision\models\detection
    copying torchvision\models\detection\_utils.py -> build\lib.win-amd64-3.9\torchvision\models\detection
    copying torchvision\models\detection\__init__.py -> build\lib.win-amd64-3.9\torchvision\models\detection
    creating build\lib.win-amd64-3.9\torchvision\models\quantization
    copying torchvision\models\quantization\googlenet.py -> build\lib.win-amd64-3.9\torchvision\models\quantization
    copying torchvision\models\quantization\inception.py -> build\lib.win-amd64-3.9\torchvision\models\quantization
    copying torchvision\models\quantization\mobilenet.py -> build\lib.win-amd64-3.9\torchvision\models\quantization
    copying torchvision\models\quantization\mobilenetv2.py -> build\lib.win-amd64-3.9\torchvision\models\quantization
    copying torchvision\models\quantization\mobilenetv3.py -> build\lib.win-amd64-3.9\torchvision\models\quantization
    copying torchvision\models\quantization\resnet.py -> build\lib.win-amd64-3.9\torchvision\models\quantization
    copying torchvision\models\quantization\shufflenetv2.py -> build\lib.win-amd64-3.9\torchvision\models\quantization
    copying torchvision\models\quantization\utils.py -> build\lib.win-amd64-3.9\torchvision\models\quantization
    copying torchvision\models\quantization\__init__.py -> build\lib.win-amd64-3.9\torchvision\models\quantization
    creating build\lib.win-amd64-3.9\torchvision\models\segmentation
    copying torchvision\models\segmentation\deeplabv3.py -> build\lib.win-amd64-3.9\torchvision\models\segmentation
    copying torchvision\models\segmentation\fcn.py -> build\lib.win-amd64-3.9\torchvision\models\segmentation
    copying torchvision\models\segmentation\lraspp.py -> build\lib.win-amd64-3.9\torchvision\models\segmentation
    copying torchvision\models\segmentation\segmentation.py -> build\lib.win-amd64-3.9\torchvision\models\segmentation
    copying torchvision\models\segmentation\_utils.py -> build\lib.win-amd64-3.9\torchvision\models\segmentation
    copying torchvision\models\segmentation\__init__.py -> build\lib.win-amd64-3.9\torchvision\models\segmentation
    creating build\lib.win-amd64-3.9\torchvision\models\video
    copying torchvision\models\video\resnet.py -> build\lib.win-amd64-3.9\torchvision\models\video
    copying torchvision\models\video\__init__.py -> build\lib.win-amd64-3.9\torchvision\models\video
    running build_ext
    D:\ProgramData\Anaconda3\envs\pytorch_1.7.1_gpu\lib\site-packages\torch\utils\cpp_extension.py:352: UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja.. Falling back to using the slow d
istutils backend.
      warnings.warn(msg.format('we could not find ninja.'))
    D:\ProgramData\Anaconda3\envs\pytorch_1.7.1_gpu\lib\site-packages\torch\utils\cpp_extension.py:287: UserWarning: Error checking compiler version for cl: [WinError 2] 系统找不到指定的文件。
      warnings.warn('Error checking compiler version for {}: {}'.format(compiler, error))
    building 'torchvision._C' extension
    error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
    Error in atexit._run_exitfuncs:
    Traceback (most recent call last):
      File "D:\ProgramData\Anaconda3\envs\pytorch_1.7.1_gpu\lib\site-packages\colorama\ansitowin32.py", line 59, in closed
        return stream.closed
    ValueError: underlying buffer has been detached
    ----------------------------------------
  Rolling back uninstall of torchvision
  Moving to d:\programdata\anaconda3\envs\pytorch_1.7.1_gpu\lib\site-packages\torchvision-0.8.2+cu110.dist-info\
   from D:\ProgramData\Anaconda3\envs\pytorch_1.7.1_gpu\Lib\site-packages\~orchvision-0.8.2+cu110.dist-info
  Moving to d:\programdata\anaconda3\envs\pytorch_1.7.1_gpu\lib\site-packages\torchvision\__init__.py
   from C:\Users\Administrator\AppData\Local\Temp\pip-uninstall-kgs1dr_g\__init__.py
  Moving to d:\programdata\anaconda3\envs\pytorch_1.7.1_gpu\lib\site-packages\torchvision\__pycache__\
   from D:\ProgramData\Anaconda3\envs\pytorch_1.7.1_gpu\Lib\site-packages\torchvision\~_pycache__
  Moving to d:\programdata\anaconda3\envs\pytorch_1.7.1_gpu\lib\site-packages\torchvision\_c.pyd
   from C:\Users\Administrator\AppData\Local\Temp\pip-uninstall-kgs1dr_g\_c.pyd
  Moving to d:\programdata\anaconda3\envs\pytorch_1.7.1_gpu\lib\site-packages\torchvision\datasets\
   from D:\ProgramData\Anaconda3\envs\pytorch_1.7.1_gpu\Lib\site-packages\torchvision\~atasets
  Moving to d:\programdata\anaconda3\envs\pytorch_1.7.1_gpu\lib\site-packages\torchvision\extension.py
   from C:\Users\Administrator\AppData\Local\Temp\pip-uninstall-kgs1dr_g\extension.py
  Moving to d:\programdata\anaconda3\envs\pytorch_1.7.1_gpu\lib\site-packages\torchvision\image.pyd
   from C:\Users\Administrator\AppData\Local\Temp\pip-uninstall-kgs1dr_g\image.pyd
  Moving to d:\programdata\anaconda3\envs\pytorch_1.7.1_gpu\lib\site-packages\torchvision\io\
   from D:\ProgramData\Anaconda3\envs\pytorch_1.7.1_gpu\Lib\site-packages\torchvision\~o
  Moving to d:\programdata\anaconda3\envs\pytorch_1.7.1_gpu\lib\site-packages\torchvision\libjpeg.dll
   from C:\Users\Administrator\AppData\Local\Temp\pip-uninstall-kgs1dr_g\libjpeg.dll
  Moving to d:\programdata\anaconda3\envs\pytorch_1.7.1_gpu\lib\site-packages\torchvision\libpng16.dll
   from C:\Users\Administrator\AppData\Local\Temp\pip-uninstall-kgs1dr_g\libpng16.dll
  Moving to d:\programdata\anaconda3\envs\pytorch_1.7.1_gpu\lib\site-packages\torchvision\models\__init__.py
   from C:\Users\Administrator\AppData\Local\Temp\pip-uninstall-kgs1dr_g\models\__init__.py
  Moving to d:\programdata\anaconda3\envs\pytorch_1.7.1_gpu\lib\site-packages\torchvision\models\__pycache__\
   from D:\ProgramData\Anaconda3\envs\pytorch_1.7.1_gpu\Lib\site-packages\torchvision\models\~_pycache__
  Moving to d:\programdata\anaconda3\envs\pytorch_1.7.1_gpu\lib\site-packages\torchvision\models\_utils.py
   from C:\Users\Administrator\AppData\Local\Temp\pip-uninstall-kgs1dr_g\models\_utils.py
  Moving to d:\programdata\anaconda3\envs\pytorch_1.7.1_gpu\lib\site-packages\torchvision\models\alexnet.py
   from C:\Users\Administrator\AppData\Local\Temp\pip-uninstall-kgs1dr_g\models\alexnet.py
  Moving to d:\programdata\anaconda3\envs\pytorch_1.7.1_gpu\lib\site-packages\torchvision\models\densenet.py
   from C:\Users\Administrator\AppData\Local\Temp\pip-uninstall-kgs1dr_g\models\densenet.py
  Moving to d:\programdata\anaconda3\envs\pytorch_1.7.1_gpu\lib\site-packages\torchvision\models\detection\
   from D:\ProgramData\Anaconda3\envs\pytorch_1.7.1_gpu\Lib\site-packages\torchvision\models\~etection
  Moving to d:\programdata\anaconda3\envs\pytorch_1.7.1_gpu\lib\site-packages\torchvision\models\googlenet.py
   from C:\Users\Administrator\AppData\Local\Temp\pip-uninstall-kgs1dr_g\models\googlenet.py
  Moving to d:\programdata\anaconda3\envs\pytorch_1.7.1_gpu\lib\site-packages\torchvision\models\inception.py
   from C:\Users\Administrator\AppData\Local\Temp\pip-uninstall-kgs1dr_g\models\inception.py
  Moving to d:\programdata\anaconda3\envs\pytorch_1.7.1_gpu\lib\site-packages\torchvision\models\mnasnet.py
   from C:\Users\Administrator\AppData\Local\Temp\pip-uninstall-kgs1dr_g\models\mnasnet.py
  Moving to d:\programdata\anaconda3\envs\pytorch_1.7.1_gpu\lib\site-packages\torchvision\models\mobilenet.py
   from C:\Users\Administrator\AppData\Local\Temp\pip-uninstall-kgs1dr_g\models\mobilenet.py
  Moving to d:\programdata\anaconda3\envs\pytorch_1.7.1_gpu\lib\site-packages\torchvision\models\quantization\
   from D:\ProgramData\Anaconda3\envs\pytorch_1.7.1_gpu\Lib\site-packages\torchvision\models\~uantization
  Moving to d:\programdata\anaconda3\envs\pytorch_1.7.1_gpu\lib\site-packages\torchvision\models\resnet.py
   from C:\Users\Administrator\AppData\Local\Temp\pip-uninstall-kgs1dr_g\models\resnet.py
  Moving to d:\programdata\anaconda3\envs\pytorch_1.7.1_gpu\lib\site-packages\torchvision\models\segmentation\
   from D:\ProgramData\Anaconda3\envs\pytorch_1.7.1_gpu\Lib\site-packages\torchvision\models\~egmentation
  Moving to d:\programdata\anaconda3\envs\pytorch_1.7.1_gpu\lib\site-packages\torchvision\models\shufflenetv2.py
   from C:\Users\Administrator\AppData\Local\Temp\pip-uninstall-kgs1dr_g\models\shufflenetv2.py
  Moving to d:\programdata\anaconda3\envs\pytorch_1.7.1_gpu\lib\site-packages\torchvision\models\squeezenet.py
   from C:\Users\Administrator\AppData\Local\Temp\pip-uninstall-kgs1dr_g\models\squeezenet.py
  Moving to d:\programdata\anaconda3\envs\pytorch_1.7.1_gpu\lib\site-packages\torchvision\models\utils.py
   from C:\Users\Administrator\AppData\Local\Temp\pip-uninstall-kgs1dr_g\models\utils.py
  Moving to d:\programdata\anaconda3\envs\pytorch_1.7.1_gpu\lib\site-packages\torchvision\models\vgg.py
   from C:\Users\Administrator\AppData\Local\Temp\pip-uninstall-kgs1dr_g\models\vgg.py
  Moving to d:\programdata\anaconda3\envs\pytorch_1.7.1_gpu\lib\site-packages\torchvision\models\video\
   from D:\ProgramData\Anaconda3\envs\pytorch_1.7.1_gpu\Lib\site-packages\torchvision\models\~ideo
  Moving to d:\programdata\anaconda3\envs\pytorch_1.7.1_gpu\lib\site-packages\torchvision\ops\
   from D:\ProgramData\Anaconda3\envs\pytorch_1.7.1_gpu\Lib\site-packages\torchvision\~ps
  Moving to d:\programdata\anaconda3\envs\pytorch_1.7.1_gpu\lib\site-packages\torchvision\transforms\__init__.py
   from C:\Users\Administrator\AppData\Local\Temp\pip-uninstall-kgs1dr_g\transforms\__init__.py
  Moving to d:\programdata\anaconda3\envs\pytorch_1.7.1_gpu\lib\site-packages\torchvision\transforms\__pycache__\
   from D:\ProgramData\Anaconda3\envs\pytorch_1.7.1_gpu\Lib\site-packages\torchvision\transforms\~_pycache__
  Moving to d:\programdata\anaconda3\envs\pytorch_1.7.1_gpu\lib\site-packages\torchvision\transforms\_functional_video.py
   from C:\Users\Administrator\AppData\Local\Temp\pip-uninstall-kgs1dr_g\transforms\_functional_video.py
  Moving to d:\programdata\anaconda3\envs\pytorch_1.7.1_gpu\lib\site-packages\torchvision\transforms\_transforms_video.py
   from C:\Users\Administrator\AppData\Local\Temp\pip-uninstall-kgs1dr_g\transforms\_transforms_video.py
  Moving to d:\programdata\anaconda3\envs\pytorch_1.7.1_gpu\lib\site-packages\torchvision\transforms\functional.py
   from C:\Users\Administrator\AppData\Local\Temp\pip-uninstall-kgs1dr_g\transforms\functional.py
  Moving to d:\programdata\anaconda3\envs\pytorch_1.7.1_gpu\lib\site-packages\torchvision\transforms\functional_pil.py
   from C:\Users\Administrator\AppData\Local\Temp\pip-uninstall-kgs1dr_g\transforms\functional_pil.py
  Moving to d:\programdata\anaconda3\envs\pytorch_1.7.1_gpu\lib\site-packages\torchvision\transforms\functional_tensor.py
   from C:\Users\Administrator\AppData\Local\Temp\pip-uninstall-kgs1dr_g\transforms\functional_tensor.py
  Moving to d:\programdata\anaconda3\envs\pytorch_1.7.1_gpu\lib\site-packages\torchvision\transforms\transforms.py
   from C:\Users\Administrator\AppData\Local\Temp\pip-uninstall-kgs1dr_g\transforms\transforms.py
  Moving to d:\programdata\anaconda3\envs\pytorch_1.7.1_gpu\lib\site-packages\torchvision\utils.py
   from C:\Users\Administrator\AppData\Local\Temp\pip-uninstall-kgs1dr_g\utils.py
  Moving to d:\programdata\anaconda3\envs\pytorch_1.7.1_gpu\lib\site-packages\torchvision\version.py
   from C:\Users\Administrator\AppData\Local\Temp\pip-uninstall-kgs1dr_g\version.py
  Moving to d:\programdata\anaconda3\envs\pytorch_1.7.1_gpu\lib\site-packages\torchvision\zlib.dll
   from C:\Users\Administrator\AppData\Local\Temp\pip-uninstall-kgs1dr_g\zlib.dll
ERROR: Command errored out with exit status 1: 'D:\ProgramData\Anaconda3\envs\pytorch_1.7.1_gpu\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-req-build-wt
2kc08a\\setup.py'"'"'; __file__='"'"'C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-req-build-wt2kc08a\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.clo
se();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Administrator\AppData\Local\Temp\pip-record-nj0p9knr\install-record.txt' --single-version-externally-managed --compile --install-headers 'D:\ProgramData\
Anaconda3\envs\pytorch_1.7.1_gpu\Include\torchvision' Check the logs for full command output.

实现上安装到 C:\Users\Administrator.cache\torch\hub (每个人安装的地方不一样,通过运行程序可以看出在什么地方)

现在执行安装:

(pytorch_1.7.1_gpu) E:\PythonPRO\PytorchPro\G5\vision-master\vision-master>python setup.py install
Building wheel torchvision-0.10.0a0
PNG found: True
Running build on conda-build: False
Running build on conda: True
JPEG found: False
FFmpeg found: False
running install
running bdist_egg
running egg_info
creating torchvision.egg-info
writing torchvision.egg-info\PKG-INFO
writing dependency_links to torchvision.egg-info\dependency_links.txt
writing requirements to torchvision.egg-info\requires.txt
writing top-level names to torchvision.egg-info\top_level.txt
writing manifest file 'torchvision.egg-info\SOURCES.txt'
D:\ProgramData\Anaconda3\envs\pytorch_1.7.1_gpu\lib\site-packages\torch\utils\cpp_extension.py:352: UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja.. Falling back to using the slow distu
tils backend.
  warnings.warn(msg.format('we could not find ninja.'))
reading manifest file 'torchvision.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files matching '__pycache__' found under directory '*'
warning: no previously-included files matching '*.py[co]' found under directory '*'
writing manifest file 'torchvision.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
creating build
creating build\lib.win-amd64-3.9
creating build\lib.win-amd64-3.9\torchvision
copying torchvision\extension.py -> build\lib.win-amd64-3.9\torchvision
copying torchvision\utils.py -> build\lib.win-amd64-3.9\torchvision
copying torchvision\version.py -> build\lib.win-amd64-3.9\torchvision
copying torchvision\__init__.py -> build\lib.win-amd64-3.9\torchvision
creating build\lib.win-amd64-3.9\torchvision\datasets
copying torchvision\datasets\caltech.py -> build\lib.win-amd64-3.9\torchvision\datasets
copying torchvision\datasets\celeba.py -> build\lib.win-amd64-3.9\torchvision\datasets
copying torchvision\datasets\cifar.py -> build\lib.win-amd64-3.9\torchvision\datasets
copying torchvision\datasets\cityscapes.py -> build\lib.win-amd64-3.9\torchvision\datasets
copying torchvision\datasets\coco.py -> build\lib.win-amd64-3.9\torchvision\datasets
copying torchvision\datasets\fakedata.py -> build\lib.win-amd64-3.9\torchvision\datasets
copying torchvision\datasets\flickr.py -> build\lib.win-amd64-3.9\torchvision\datasets
copying torchvision\datasets\folder.py -> build\lib.win-amd64-3.9\torchvision\datasets
copying torchvision\datasets\hmdb51.py -> build\lib.win-amd64-3.9\torchvision\datasets
copying torchvision\datasets\imagenet.py -> build\lib.win-amd64-3.9\torchvision\datasets
copying torchvision\datasets\kinetics.py -> build\lib.win-amd64-3.9\torchvision\datasets
copying torchvision\datasets\kitti.py -> build\lib.win-amd64-3.9\torchvision\datasets
copying torchvision\datasets\lsun.py -> build\lib.win-amd64-3.9\torchvision\datasets
copying torchvision\datasets\mnist.py -> build\lib.win-amd64-3.9\torchvision\datasets
copying torchvision\datasets\omniglot.py -> build\lib.win-amd64-3.9\torchvision\datasets
copying torchvision\datasets\phototour.py -> build\lib.win-amd64-3.9\torchvision\datasets
copying torchvision\datasets\places365.py -> build\lib.win-amd64-3.9\torchvision\datasets
copying torchvision\datasets\sbd.py -> build\lib.win-amd64-3.9\torchvision\datasets
copying torchvision\datasets\sbu.py -> build\lib.win-amd64-3.9\torchvision\datasets
copying torchvision\datasets\semeion.py -> build\lib.win-amd64-3.9\torchvision\datasets
copying torchvision\datasets\stl10.py -> build\lib.win-amd64-3.9\torchvision\datasets
copying torchvision\datasets\svhn.py -> build\lib.win-amd64-3.9\torchvision\datasets
copying torchvision\datasets\ucf101.py -> build\lib.win-amd64-3.9\torchvision\datasets
copying torchvision\datasets\usps.py -> build\lib.win-amd64-3.9\torchvision\datasets
copying torchvision\datasets\utils.py -> build\lib.win-amd64-3.9\torchvision\datasets
copying torchvision\datasets\video_utils.py -> build\lib.win-amd64-3.9\torchvision\datasets
copying torchvision\datasets\vision.py -> build\lib.win-amd64-3.9\torchvision\datasets
copying torchvision\datasets\voc.py -> build\lib.win-amd64-3.9\torchvision\datasets
copying torchvision\datasets\widerface.py -> build\lib.win-amd64-3.9\torchvision\datasets
copying torchvision\datasets\__init__.py -> build\lib.win-amd64-3.9\torchvision\datasets
creating build\lib.win-amd64-3.9\torchvision\io
copying torchvision\io\image.py -> build\lib.win-amd64-3.9\torchvision\io
copying torchvision\io\video.py -> build\lib.win-amd64-3.9\torchvision\io
copying torchvision\io\_video_opt.py -> build\lib.win-amd64-3.9\torchvision\io
copying torchvision\io\__init__.py -> build\lib.win-amd64-3.9\torchvision\io
creating build\lib.win-amd64-3.9\torchvision\models
copying torchvision\models\alexnet.py -> build\lib.win-amd64-3.9\torchvision\models
copying torchvision\models\densenet.py -> build\lib.win-amd64-3.9\torchvision\models
copying torchvision\models\googlenet.py -> build\lib.win-amd64-3.9\torchvision\models
copying torchvision\models\inception.py -> build\lib.win-amd64-3.9\torchvision\models
copying torchvision\models\mnasnet.py -> build\lib.win-amd64-3.9\torchvision\models
copying torchvision\models\mobilenet.py -> build\lib.win-amd64-3.9\torchvision\models
copying torchvision\models\mobilenetv2.py -> build\lib.win-amd64-3.9\torchvision\models
copying torchvision\models\mobilenetv3.py -> build\lib.win-amd64-3.9\torchvision\models
copying torchvision\models\resnet.py -> build\lib.win-amd64-3.9\torchvision\models
copying torchvision\models\shufflenetv2.py -> build\lib.win-amd64-3.9\torchvision\models
copying torchvision\models\squeezenet.py -> build\lib.win-amd64-3.9\torchvision\models
copying torchvision\models\utils.py -> build\lib.win-amd64-3.9\torchvision\models
copying torchvision\models\vgg.py -> build\lib.win-amd64-3.9\torchvision\models
copying torchvision\models\_utils.py -> build\lib.win-amd64-3.9\torchvision\models
copying torchvision\models\__init__.py -> build\lib.win-amd64-3.9\torchvision\models
creating build\lib.win-amd64-3.9\torchvision\ops
copying torchvision\ops\boxes.py -> build\lib.win-amd64-3.9\torchvision\ops
copying torchvision\ops\deform_conv.py -> build\lib.win-amd64-3.9\torchvision\ops
copying torchvision\ops\feature_pyramid_network.py -> build\lib.win-amd64-3.9\torchvision\ops
copying torchvision\ops\focal_loss.py -> build\lib.win-amd64-3.9\torchvision\ops
copying torchvision\ops\misc.py -> build\lib.win-amd64-3.9\torchvision\ops
copying torchvision\ops\poolers.py -> build\lib.win-amd64-3.9\torchvision\ops
copying torchvision\ops\ps_roi_align.py -> build\lib.win-amd64-3.9\torchvision\ops
copying torchvision\ops\ps_roi_pool.py -> build\lib.win-amd64-3.9\torchvision\ops
copying torchvision\ops\roi_align.py -> build\lib.win-amd64-3.9\torchvision\ops
copying torchvision\ops\roi_pool.py -> build\lib.win-amd64-3.9\torchvision\ops
copying torchvision\ops\_box_convert.py -> build\lib.win-amd64-3.9\torchvision\ops
copying torchvision\ops\_register_onnx_ops.py -> build\lib.win-amd64-3.9\torchvision\ops
copying torchvision\ops\_utils.py -> build\lib.win-amd64-3.9\torchvision\ops
copying torchvision\ops\__init__.py -> build\lib.win-amd64-3.9\torchvision\ops
creating build\lib.win-amd64-3.9\torchvision\transforms
copying torchvision\transforms\autoaugment.py -> build\lib.win-amd64-3.9\torchvision\transforms
copying torchvision\transforms\functional.py -> build\lib.win-amd64-3.9\torchvision\transforms
copying torchvision\transforms\functional_pil.py -> build\lib.win-amd64-3.9\torchvision\transforms
copying torchvision\transforms\functional_tensor.py -> build\lib.win-amd64-3.9\torchvision\transforms
copying torchvision\transforms\transforms.py -> build\lib.win-amd64-3.9\torchvision\transforms
copying torchvision\transforms\_functional_video.py -> build\lib.win-amd64-3.9\torchvision\transforms
copying torchvision\transforms\_transforms_video.py -> build\lib.win-amd64-3.9\torchvision\transforms
copying torchvision\transforms\__init__.py -> build\lib.win-amd64-3.9\torchvision\transforms
creating build\lib.win-amd64-3.9\torchvision\datasets\samplers
copying torchvision\datasets\samplers\clip_sampler.py -> build\lib.win-amd64-3.9\torchvision\datasets\samplers
copying torchvision\datasets\samplers\__init__.py -> build\lib.win-amd64-3.9\torchvision\datasets\samplers
creating build\lib.win-amd64-3.9\torchvision\models\detection
copying torchvision\models\detection\anchor_utils.py -> build\lib.win-amd64-3.9\torchvision\models\detection
copying torchvision\models\detection\backbone_utils.py -> build\lib.win-amd64-3.9\torchvision\models\detection
copying torchvision\models\detection\faster_rcnn.py -> build\lib.win-amd64-3.9\torchvision\models\detection
copying torchvision\models\detection\generalized_rcnn.py -> build\lib.win-amd64-3.9\torchvision\models\detection
copying torchvision\models\detection\image_list.py -> build\lib.win-amd64-3.9\torchvision\models\detection
copying torchvision\models\detection\keypoint_rcnn.py -> build\lib.win-amd64-3.9\torchvision\models\detection
copying torchvision\models\detection\mask_rcnn.py -> build\lib.win-amd64-3.9\torchvision\models\detection
copying torchvision\models\detection\retinanet.py -> build\lib.win-amd64-3.9\torchvision\models\detection
copying torchvision\models\detection\roi_heads.py -> build\lib.win-amd64-3.9\torchvision\models\detection
copying torchvision\models\detection\rpn.py -> build\lib.win-amd64-3.9\torchvision\models\detection
copying torchvision\models\detection\transform.py -> build\lib.win-amd64-3.9\torchvision\models\detection
copying torchvision\models\detection\_utils.py -> build\lib.win-amd64-3.9\torchvision\models\detection
copying torchvision\models\detection\__init__.py -> build\lib.win-amd64-3.9\torchvision\models\detection
creating build\lib.win-amd64-3.9\torchvision\models\quantization
copying torchvision\models\quantization\googlenet.py -> build\lib.win-amd64-3.9\torchvision\models\quantization
copying torchvision\models\quantization\inception.py -> build\lib.win-amd64-3.9\torchvision\models\quantization
copying torchvision\models\quantization\mobilenet.py -> build\lib.win-amd64-3.9\torchvision\models\quantization
copying torchvision\models\quantization\mobilenetv2.py -> build\lib.win-amd64-3.9\torchvision\models\quantization
copying torchvision\models\quantization\mobilenetv3.py -> build\lib.win-amd64-3.9\torchvision\models\quantization
copying torchvision\models\quantization\resnet.py -> build\lib.win-amd64-3.9\torchvision\models\quantization
copying torchvision\models\quantization\shufflenetv2.py -> build\lib.win-amd64-3.9\torchvision\models\quantization
copying torchvision\models\quantization\utils.py -> build\lib.win-amd64-3.9\torchvision\models\quantization
copying torchvision\models\quantization\__init__.py -> build\lib.win-amd64-3.9\torchvision\models\quantization
creating build\lib.win-amd64-3.9\torchvision\models\segmentation
copying torchvision\models\segmentation\deeplabv3.py -> build\lib.win-amd64-3.9\torchvision\models\segmentation
copying torchvision\models\segmentation\fcn.py -> build\lib.win-amd64-3.9\torchvision\models\segmentation
copying torchvision\models\segmentation\lraspp.py -> build\lib.win-amd64-3.9\torchvision\models\segmentation
copying torchvision\models\segmentation\segmentation.py -> build\lib.win-amd64-3.9\torchvision\models\segmentation
copying torchvision\models\segmentation\_utils.py -> build\lib.win-amd64-3.9\torchvision\models\segmentation
copying torchvision\models\segmentation\__init__.py -> build\lib.win-amd64-3.9\torchvision\models\segmentation
creating build\lib.win-amd64-3.9\torchvision\models\video
copying torchvision\models\video\resnet.py -> build\lib.win-amd64-3.9\torchvision\models\video
copying torchvision\models\video\__init__.py -> build\lib.win-amd64-3.9\torchvision\models\video
running build_ext
D:\ProgramData\Anaconda3\envs\pytorch_1.7.1_gpu\lib\site-packages\torch\utils\cpp_extension.py:287: UserWarning: Error checking compiler version for cl: [WinError 2] 系统找不到指定的文件。
  warnings.warn('Error checking compiler version for {}: {}'.format(compiler, error))
building 'torchvision._C' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/

安装时开始报错,却少东西
torch.hub.list(‘pytorch/vision‘)的安装记录_第1张图片
安装ninja
在这里插入图片描述
torch.hub.list(‘pytorch/vision‘)的安装记录_第2张图片

又缺少cl,安装cl
torch.hub.list(‘pytorch/vision‘)的安装记录_第3张图片
又出现需要安装 Visual Studio 2019
torch.hub.list(‘pytorch/vision‘)的安装记录_第4张图片
安装 Visual Studio 2019
来源:https://visualstudio.microsoft.com/zh-hans/vs/

再次运行又出错:
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
running build_ext
D:\ProgramData\Anaconda3\envs\pytorch_gpu\lib\site-packages\torch\utils\cpp_extension.py:287: UserWarning: Error checking compiler version for cl: Command ‘cl’ returned non-zero exit status 1.
在这里插入图片描述
再次运行程序:

torch.hub.list(‘pytorch/vision‘)的安装记录_第5张图片

提示没有模块:

torchvision.models.mobilnetv2

在这里插入图片描述
这里面主要用到2个文件:

D:\ProgramData\Anaconda3\envs\pytorch_gpu\Lib\site-packages\torch
C:\Users\Administrator\.cache\torch\hub\pytorch_vision_master\hubconf.py

并按着下面注释掉不要的:

# Optional list of dependencies required by the package
dependencies = ['torch']

# classification
from torchvision.models.alexnet import alexnet
from torchvision.models.densenet import densenet121, densenet169, densenet201, densenet161
from torchvision.models.inception import inception_v3
from torchvision.models.resnet import resnet18, resnet34, resnet50, resnet101, resnet152,\
    resnext50_32x4d, resnext101_32x8d, wide_resnet50_2, wide_resnet101_2
from torchvision.models.squeezenet import squeezenet1_0, squeezenet1_1
from torchvision.models.vgg import vgg11, vgg13, vgg16, vgg19, vgg11_bn, vgg13_bn, vgg16_bn, vgg19_bn
from torchvision.models.googlenet import googlenet
from torchvision.models.shufflenetv2 import shufflenet_v2_x0_5, shufflenet_v2_x1_0
# from torchvision.models.mobilenetv2 import mobilenet_v2
# from torchvision.models.mobilenetv2 import mobilenetv2
# from torchvision.models.mobilenetv3 import mobilenet_v3_large, mobilenet_v3_small
# from torchvision.models.mnasnet import mnasnet0_5, mnasnet0_75, mnasnet1_0, \
#     mnasnet1_3

# segmentation
# from torchvision.models.segmentation import fcn_resnet50, fcn_resnet101, \
#     deeplabv3_resnet50, deeplabv3_resnet101, deeplabv3_mobilenet_v3_large, lraspp_mobilenet_v3_large

from torchvision.models.segmentation import fcn_resnet50, fcn_resnet101, \
   deeplabv3_resnet50, deeplabv3_resnet101

再次运行

Using cache found in C:\Users\Administrator/.cache\torch\hub\pytorch_vision_master
Using cache found in C:\Users\Administrator/.cache\torch\hub\pytorch_vision_master
Downloading: "https://download.pytorch.org/models/resnet101-5d3b4d8f.pth" to C:\Users\Administrator/.cache\torch\hub\checkpoints\resnet101-5d3b4d8f.pth
4.2%
Traceback (most recent call last):
  File "E:\PythonPRO\PytorchPro\G5\1_seg_demo.py", line 55, in 
    model = torch.hub.load('pytorch/vision', 'deeplabv3_resnet101', pretrained=True)  # pretrained=True 设为预训练模式
  File "D:\ProgramData\Anaconda3\envs\pytorch_gpu\lib\site-packages\torch\hub.py", line 371, in load
    model = _load_local(repo_or_dir, model, *args, **kwargs)
  File "D:\ProgramData\Anaconda3\envs\pytorch_gpu\lib\site-packages\torch\hub.py", line 400, in _load_local
    model = entry(*args, **kwargs)
  File "D:\ProgramData\Anaconda3\envs\pytorch_gpu\lib\site-packages\torchvision\models\segmentation\segmentation.py", line 106, in deeplabv3_resnet101
    return _load_model('deeplabv3', 'resnet101', pretrained, progress, num_classes, aux_loss, **kwargs)
  File "D:\ProgramData\Anaconda3\envs\pytorch_gpu\lib\site-packages\torchvision\models\segmentation\segmentation.py", line 49, in _load_model
    model = _segm_resnet(arch_type, backbone, num_classes, aux_loss, **kwargs)
  File "D:\ProgramData\Anaconda3\envs\pytorch_gpu\lib\site-packages\torchvision\models\segmentation\segmentation.py", line 20, in _segm_resnet
    backbone = resnet.__dict__[backbone_name](
  File "D:\ProgramData\Anaconda3\envs\pytorch_gpu\lib\site-packages\torchvision\models\resnet.py", line 278, in resnet101
    return _resnet('resnet101', Bottleneck, [3, 4, 23, 3], pretrained, progress,
  File "D:\ProgramData\Anaconda3\envs\pytorch_gpu\lib\site-packages\torchvision\models\resnet.py", line 228, in _resnet
    state_dict = load_state_dict_from_url(model_urls[arch],
  File "D:\ProgramData\Anaconda3\envs\pytorch_gpu\lib\site-packages\torch\hub.py", line 556, in load_state_dict_from_url
    download_url_to_file(url, cached_file, hash_prefix, progress=progress)
  File "D:\ProgramData\Anaconda3\envs\pytorch_gpu\lib\site-packages\torch\hub.py", line 448, in download_url_to_file
    buffer = u.read(8192)
  File "D:\ProgramData\Anaconda3\envs\pytorch_gpu\lib\http\client.py", line 459, in read
    n = self.readinto(b)
  File "D:\ProgramData\Anaconda3\envs\pytorch_gpu\lib\http\client.py", line 503, in readinto
    n = self.fp.readinto(b)
  File "D:\ProgramData\Anaconda3\envs\pytorch_gpu\lib\socket.py", line 704, in readinto
    return self._sock.recv_into(b)
  File "D:\ProgramData\Anaconda3\envs\pytorch_gpu\lib\ssl.py", line 1241, in recv_into
    return self.read(nbytes, buffer)
  File "D:\ProgramData\Anaconda3\envs\pytorch_gpu\lib\ssl.py", line 1099, in read
    return self._sslobj.read(len, buffer)
ConnectionResetError: [WinError 10054] 远程主机强迫关闭了一个现有的连接。

发现不行,根据网址:
https://download.pytorch.org/models/resnet101-5d3b4d8f.pth 下载后放到:
C:\Users\Administrator.cache\torch\hub\checkpoints

再次运行,又出现:


Using cache found in C:\Users\Administrator/.cache\torch\hub\pytorch_vision_master
Downloading: "https://download.pytorch.org/models/deeplabv3_resnet101_coco-586e9e4e.pth" to C:\Users\Administrator/.cache\torch\hub\checkpoints\deeplabv3_resnet101_coco-586e9e4e.pth

再次下载:
https://download.pytorch.org/models/deeplabv3_resnet101_coco-586e9e4e.pth

下载后放到
C:\Users\Administrator.cache\torch\hub\checkpoints
再次运行即可成功。

你可能感兴趣的:(问题,深度学习)