【SwinTrack目标跟踪算法环境配置】

【SwinTrack目标跟踪算法环境配置】

  • 1 安装Torch 、Torchvision
  • 2 运行出现的问题
    • 2.1 urllib.error.URLError:

1 安装Torch 、Torchvision

pytorch 与Torchvision、CUDA的版本对应 快速查
conda install pytorch1.9.1 torchvision0.10.1 torchaudio==0.9.1 cudatoolkit=10.2 -c pytorch

2 运行出现的问题

2.1 urllib.error.URLError:

  File "/home/qy/Code/SwinTrack/models/backbone/builder.py", line 15, in build_backbone
    backbone = build_swin_transformer_backbone(load_pretrained=load_pretrained, **backbone_build_params)
  File "/home/qy/Code/SwinTrack/models/backbone/swin_transformer.py", line 732, in build_swin_transformer_backbone
    transformer.init_weights(pretrained_model_path)
  File "/home/qy/Code/SwinTrack/models/backbone/swin_transformer.py", line 621, in init_weights
    state_dict = torch.hub.load_state_dict_from_url(pretrained, map_location='cpu')['model']
  File "/home/qy/anaconda3/envs/SwinTrack/lib/python3.9/site-packages/torch/hub.py", line 571, in load_state_dict_from_url
    download_url_to_file(url, cached_file, hash_prefix, progress=progress)
  File "/home/qy/anaconda3/envs/SwinTrack/lib/python3.9/site-packages/torch/hub.py", line 437, in download_url_to_file
    u = urlopen(req)
  File "/home/qy/anaconda3/envs/SwinTrack/lib/python3.9/urllib/request.py", line 214, in urlopen
    return opener.open(url, data, timeout)
  File "/home/qy/anaconda3/envs/SwinTrack/lib/python3.9/urllib/request.py", line 517, in open
    response = self._open(req, data)
  File "/home/qy/anaconda3/envs/SwinTrack/lib/python3.9/urllib/request.py", line 534, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
  File "/home/qy/anaconda3/envs/SwinTrack/lib/python3.9/urllib/request.py", line 494, in _call_chain
    result = func(*args)
  File "/home/qy/anaconda3/envs/SwinTrack/lib/python3.9/urllib/request.py", line 1389, in https_open
    return self.do_open(http.client.HTTPSConnection, req,
  File "/home/qy/anaconda3/envs/SwinTrack/lib/python3.9/urllib/request.py", line 1349, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [Errno -2] Name or service not known>

解决办法:在/etc/resolv.conf中添加 nameserver 8.8.8.8

2.2 ModuleNotFoundError: No module named ‘fvcore’

pip install --ignore-installed PyYAML
pip install fvcore

你可能感兴趣的:(笔记,目标跟踪,算法,pytorch)