Pytracking代码运行笔记

https://github.com/visionml/pytracking

1.git clone https://github.com/visionml/pytracking.git
2.cd pytracking/
3.git submodule update --init  
4.
bash install.sh conda_install_path pytracking
conda_install_path替换为:
which conda
输出anaconda3的路径
即为:
bash install.sh /data/anaconda3 pytracking
特别的,关注一下install.sh强大的环境安装脚本文件
!!!应用脚本安装不成功(conda环境丢失),于是手动创建环境,手动安装

conda install -y XXX 表示确认安装,确认创建
当执行:python -c "XXX"时,XXX表示要执行的命令,例如:
输入:python -c "import os; print(os.sys.executable)" 
结果为:/usr/bin/python


5.
需要翻墙下载的两个权重模型:
https://docs.google.com/uc?export=download&id=1aWC4waLv_te-BULoy0k-n_zS-ONms21S    可能不行
https://docs.google.com/uc?export=download&id=1ZTdQbZ1tyN27UIwUnUrjHChQb5ug2sxr   真垃圾不行!
https://drive.google.com/drive/folders/1WVhJqvdu-_JG1U-V0IqfxTUa1SBPnL0O   可以了!


6.
运行:python run_webcam.py atom default时
出现错误:EOFError: Ran out of input 
经过检索发现经常会在load文件不成功时出现该错误,于是去查看了模型文件,发现模型文件为空(0byte),则确定是模型文件出现问题,则翻墙自行下载模型文件,下载文件出错。
出现错误:
No matching checkpoint file found
需要翻墙下载正确的权重模型。
解决方案:
多翻一翻issues中的问题和解答,总是有帮助的。

不可以直接对下载的文件直接进行解压,会报错,因为他是一个torch的模型,需要用torch.load()来导入该文件。
记得把文件名atom_default.pth.tar改名为:atom_default.pth(直接重命名即可)

7.
python run_tracker.py tracker_name parameter_name --dataset_name dataset_name --sequence sequence --debug debug --threads threads
改为:
python run_tracker.py atom default --dataset_name otb --sequence Soccer --debug debug --threads threads
改为:
python run_tracker.py atom default --dataset otb --sequence Soccer


python run_experiment.py experiment_module experiment_name --dataset_name dataset_name --sequence sequence --debug debug --threads threads
改为:
python run_experiment.py  myexperiments  atom_nfs_uav --dataset otb --sequence Soccer
改为:
python run_experiment.py  myexperiments  atom_nfs_uav

8.
在成功解决No matching checkpoint file found问题之后,运行7中的两条命令都报错:
RuntimeError: Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False. If you are running on a CPU-only machine, please use torch.load with map_location='cpu' to map your storages to the CPU.
解决方法:
出错语句:、
torch.load(model_file)
改为:
model = torch.load(model_path, map_location='cpu')

9.
解决完问题8之后,出现问题:pytorch框架下报错cuda驱动版本不满足cuda运行版本。
问题日志如下:
log:
(pytracking) 09534@09534:/data/pzn/pzncode/pytracking/pytracking$ python run_webcam.py atom default
VIDEOIO ERROR: V4L: can't open camera by index 0
No CUDA runtime is found, using CUDA_HOME='/usr/local/cuda'
Using /tmp/torch_extensions as PyTorch extensions root...
Detected CUDA files, patching ldflags
Emitting ninja build file /tmp/torch_extensions/_prroi_pooling/build.ninja...
Building extension module _prroi_pooling...
ninja: no work to do.
Loading extension module _prroi_pooling...
Traceback (most recent call last):
  File "run_webcam.py", line 35, in <module>
    main()
  File "run_webcam.py", line 31, in main
    run_webcam(args.tracker_name, args.tracker_param, args.debug)
  File "run_webcam.py", line 20, in run_webcam
    tracker.run_webcam(debug)
  File "../pytracking/evaluation/tracker.py", line 94, in run_webcam
    tracker.track_webcam()
  File "../pytracking/tracker/base/basetracker.py", line 179, in track_webcam
    self.initialize_features()
  File "../pytracking/tracker/atom/atom.py", line 19, in initialize_features
    self.params.features.initialize()
  File "../pytracking/features/extractor.py", line 16, in initialize
    f.initialize()
  File "../pytracking/features/deep.py", line 98, in initialize
    self.net.cuda()
  File "/data/anaconda3/envs/pytracking/lib/python3.7/site-packages/torch/nn/modules/module.py", line 265, in cuda
    return self._apply(lambda t: t.cuda(device))
  File "/data/anaconda3/envs/pytracking/lib/python3.7/site-packages/torch/nn/modules/module.py", line 193, in _apply
    module._apply(fn)
  File "/data/anaconda3/envs/pytracking/lib/python3.7/site-packages/torch/nn/modules/module.py", line 193, in _apply
    module._apply(fn)
  File "/data/anaconda3/envs/pytracking/lib/python3.7/site-packages/torch/nn/modules/module.py", line 199, in _apply
    param.data = fn(param.data)
  File "/data/anaconda3/envs/pytracking/lib/python3.7/site-packages/torch/nn/modules/module.py", line 265, in <lambda>
    return self._apply(lambda t: t.cuda(device))
  File "/data/anaconda3/envs/pytracking/lib/python3.7/site-packages/torch/cuda/__init__.py", line 162, in _lazy_init
    _check_driver()
  File "/data/anaconda3/envs/pytracking/lib/python3.7/site-packages/torch/cuda/__init__.py", line 91,
  • 9
    点赞
  • 65
    收藏
    觉得还不错? 一键收藏
  • 53
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值