热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

pytracking配置过程ubuntu18.04

下载代码gitclonehttps:github.comvisionmlpytracking.git创建环境https:github.comvisionmlpytracking

下载代码

git clone https://github.com/visionml/pytracking.git

创建环境 https://github.com/visionml/pytracking/blob/master/INSTALL.md

conda create --name pytracking python=3.7
conda activate pytrackingconda install pytorch torchvision cudatoolkit=10.0 -c pytorch
conda install matplotlib pandas tqdm
pip install opencv-python visdom tb-nightly scikit-image tikzplotlib gdownconda install cython
pip install pycocotools
pip install lvissudo apt-get install ninja-buildpip install spatial-correlation-sampler
sudo apt-get install libturbojpeg
pip install jpeg4py # Environment settings for pytracking. Saved at pytracking/evaluation/local.py
python -c "from pytracking.evaluation.environment import create_default_local_file; create_default_local_file()"# Environment settings for ltr. Saved at ltr/admin/local.py
python -c "from ltr.admin.environment import create_default_local_file; create_default_local_file()"# Download the default network for DiMP-50 and DiMP-18
gdown https://drive.google.com/uc\?id\=1qgachgqks2UGjKx-GdO1qylBDdB1f9KN -O pytracking/networks/dimp50.pth
gdown https://drive.google.com/uc\?id\=1MAjrRJDCbL0DSjUKFyDkUuYS1-cYBNjk -O pytracking/networks/dimp18.pth# Download the default network for ATOM
gdown https://drive.google.com/uc\?id\=1VNyr-Ds0khjM0zaq6lU-xfY74-iWxBvU -O pytracking/networks/atom_default.pth# Download the default network for ECO
gdown https://drive.google.com/uc\?id\=1aWC4waLv_te-BULoy0k-n_zS-ONms21S -O pytracking/networks/resnet18_vggmconv1.pth

可以自己离线下载模型文件,下载模型权重,下载好的文件不要解压,直接重命名,去掉.tar

https://drive.google.com/drive/folders/1WVhJqvdu-_JG1U-V0IqfxTUa1SBPnL0O

(链接来自https://blog.csdn.net/PNAN222/article/details/91049022)

模型文件放在 pytracking/networks/

python -C 发生错误:ModuleNotFoundError: No module named 'ltr.external.PreciseRoIPooling.pytorch'

https://github.com/visionml/pytracking/issues/144

 

测试视频文件:

cd pytracking
python run_webcam.py dimp dimp50

这里改为

cd pytracking
python run_webcam.py atom default a.mp4 #在pycharm参数中配置即可

中间安装pip install spatial-correlation-sampler的问题,解决办法 export CUDA_HOME=/usr/local/cuda-10.0

(pytracking) cody@cody:~$ pip install spatial-correlation-sampler
Collecting spatial-correlation-samplerUsing cached spatial_correlation_sampler-0.2.1.tar.gz (8.2 kB)
Requirement already satisfied: torch>=1.1 in ./anaconda3/envs/pytracking/lib/python3.7/site-packages (from spatial-correlation-sampler) (1.3.1)
Requirement already satisfied: numpy in ./anaconda3/envs/pytracking/lib/python3.7/site-packages (from spatial-correlation-sampler) (1.19.1)
Building wheels for collected packages: spatial-correlation-samplerBuilding wheel for spatial-correlation-sampler (setup.py) ... errorERROR: Command errored out with exit status 1:command: /home/cody/anaconda3/envs/pytracking/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-r145eod1/spatial-correlation-sampler/setup.py'"'"'; __file__='"'"'/tmp/pip-install-r145eod1/spatial-correlation-sampler/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 /tmp/pip-wheel-xy9vb1gzcwd: /tmp/pip-install-r145eod1/spatial-correlation-sampler/Complete output (19 lines):running bdist_wheelrunning buildrunning build_pycreating buildcreating build/lib.linux-x86_64-3.7creating build/lib.linux-x86_64-3.7/spatial_correlation_samplercopying Correlation_Module/spatial_correlation_sampler/spatial_correlation_sampler.py -> build/lib.linux-x86_64-3.7/spatial_correlation_samplercopying Correlation_Module/spatial_correlation_sampler/__init__.py -> build/lib.linux-x86_64-3.7/spatial_correlation_samplerrunning build_extbuilding 'spatial_correlation_sampler_backend' extensioncreating build/temp.linux-x86_64-3.7creating build/temp.linux-x86_64-3.7/Correlation_Modulegcc -pthread -B /home/cody/anaconda3/envs/pytracking/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DUSE_CUDA -I/home/cody/anaconda3/envs/pytracking/lib/python3.7/site-packages/torch/include -I/home/cody/anaconda3/envs/pytracking/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/home/cody/anaconda3/envs/pytracking/lib/python3.7/site-packages/torch/include/TH -I/home/cody/anaconda3/envs/pytracking/lib/python3.7/site-packages/torch/include/THC -I:/usr/local/cuda-10.0/include -I/home/cody/anaconda3/envs/pytracking/include/python3.7m -c Correlation_Module/correlation.cpp -o build/temp.linux-x86_64-3.7/Correlation_Module/correlation.o -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=spatial_correlation_sampler_backend -D_GLIBCXX_USE_CXX11_ABI=1 -std=c++11cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++gcc -pthread -B /home/cody/anaconda3/envs/pytracking/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DUSE_CUDA -I/home/cody/anaconda3/envs/pytracking/lib/python3.7/site-packages/torch/include -I/home/cody/anaconda3/envs/pytracking/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/home/cody/anaconda3/envs/pytracking/lib/python3.7/site-packages/torch/include/TH -I/home/cody/anaconda3/envs/pytracking/lib/python3.7/site-packages/torch/include/THC -I:/usr/local/cuda-10.0/include -I/home/cody/anaconda3/envs/pytracking/include/python3.7m -c Correlation_Module/correlation_sampler.cpp -o build/temp.linux-x86_64-3.7/Correlation_Module/correlation_sampler.o -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=spatial_correlation_sampler_backend -D_GLIBCXX_USE_CXX11_ABI=1 -std=c++11cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++:/usr/local/cuda-10.0/bin/nvcc -DUSE_CUDA -I/home/cody/anaconda3/envs/pytracking/lib/python3.7/site-packages/torch/include -I/home/cody/anaconda3/envs/pytracking/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/home/cody/anaconda3/envs/pytracking/lib/python3.7/site-packages/torch/include/TH -I/home/cody/anaconda3/envs/pytracking/lib/python3.7/site-packages/torch/include/THC -I:/usr/local/cuda-10.0/include -I/home/cody/anaconda3/envs/pytracking/include/python3.7m -c Correlation_Module/correlation_cuda_kernel.cu -o build/temp.linux-x86_64-3.7/Correlation_Module/correlation_cuda_kernel.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options '-fPIC' -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=spatial_correlation_sampler_backend -D_GLIBCXX_USE_CXX11_ABI=1 -gencode=arch=compute_61,code=sm_61 -std=c++11unable to execute ':/usr/local/cuda-10.0/bin/nvcc': No such file or directoryerror: command ':/usr/local/cuda-10.0/bin/nvcc' failed with exit status 1----------------------------------------ERROR: Failed building wheel for spatial-correlation-samplerRunning setup.py clean for spatial-correlation-sampler
Failed to build spatial-correlation-sampler
Installing collected packages: spatial-correlation-samplerRunning setup.py install for spatial-correlation-sampler ... errorERROR: Command errored out with exit status 1:command: /home/cody/anaconda3/envs/pytracking/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-r145eod1/spatial-correlation-sampler/setup.py'"'"'; __file__='"'"'/tmp/pip-install-r145eod1/spatial-correlation-sampler/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-p345xhjc/install-record.txt --single-version-externally-managed --compile --install-headers /home/cody/anaconda3/envs/pytracking/include/python3.7m/spatial-correlation-samplercwd: /tmp/pip-install-r145eod1/spatial-correlation-sampler/Complete output (19 lines):running installrunning buildrunning build_pycreating buildcreating build/lib.linux-x86_64-3.7creating build/lib.linux-x86_64-3.7/spatial_correlation_samplercopying Correlation_Module/spatial_correlation_sampler/spatial_correlation_sampler.py -> build/lib.linux-x86_64-3.7/spatial_correlation_samplercopying Correlation_Module/spatial_correlation_sampler/__init__.py -> build/lib.linux-x86_64-3.7/spatial_correlation_samplerrunning build_extbuilding 'spatial_correlation_sampler_backend' extensioncreating build/temp.linux-x86_64-3.7creating build/temp.linux-x86_64-3.7/Correlation_Modulegcc -pthread -B /home/cody/anaconda3/envs/pytracking/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DUSE_CUDA -I/home/cody/anaconda3/envs/pytracking/lib/python3.7/site-packages/torch/include -I/home/cody/anaconda3/envs/pytracking/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/home/cody/anaconda3/envs/pytracking/lib/python3.7/site-packages/torch/include/TH -I/home/cody/anaconda3/envs/pytracking/lib/python3.7/site-packages/torch/include/THC -I:/usr/local/cuda-10.0/include -I/home/cody/anaconda3/envs/pytracking/include/python3.7m -c Correlation_Module/correlation.cpp -o build/temp.linux-x86_64-3.7/Correlation_Module/correlation.o -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=spatial_correlation_sampler_backend -D_GLIBCXX_USE_CXX11_ABI=1 -std=c++11cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++gcc -pthread -B /home/cody/anaconda3/envs/pytracking/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DUSE_CUDA -I/home/cody/anaconda3/envs/pytracking/lib/python3.7/site-packages/torch/include -I/home/cody/anaconda3/envs/pytracking/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/home/cody/anaconda3/envs/pytracking/lib/python3.7/site-packages/torch/include/TH -I/home/cody/anaconda3/envs/pytracking/lib/python3.7/site-packages/torch/include/THC -I:/usr/local/cuda-10.0/include -I/home/cody/anaconda3/envs/pytracking/include/python3.7m -c Correlation_Module/correlation_sampler.cpp -o build/temp.linux-x86_64-3.7/Correlation_Module/correlation_sampler.o -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=spatial_correlation_sampler_backend -D_GLIBCXX_USE_CXX11_ABI=1 -std=c++11cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++:/usr/local/cuda-10.0/bin/nvcc -DUSE_CUDA -I/home/cody/anaconda3/envs/pytracking/lib/python3.7/site-packages/torch/include -I/home/cody/anaconda3/envs/pytracking/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/home/cody/anaconda3/envs/pytracking/lib/python3.7/site-packages/torch/include/TH -I/home/cody/anaconda3/envs/pytracking/lib/python3.7/site-packages/torch/include/THC -I:/usr/local/cuda-10.0/include -I/home/cody/anaconda3/envs/pytracking/include/python3.7m -c Correlation_Module/correlation_cuda_kernel.cu -o build/temp.linux-x86_64-3.7/Correlation_Module/correlation_cuda_kernel.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options '-fPIC' -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=spatial_correlation_sampler_backend -D_GLIBCXX_USE_CXX11_ABI=1 -gencode=arch=compute_61,code=sm_61 -std=c++11unable to execute ':/usr/local/cuda-10.0/bin/nvcc': No such file or directoryerror: command ':/usr/local/cuda-10.0/bin/nvcc' failed with exit status 1----------------------------------------
ERROR: Command errored out with exit status 1: /home/cody/anaconda3/envs/pytracking/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-r145eod1/spatial-correlation-sampler/setup.py'"'"'; __file__='"'"'/tmp/pip-install-r145eod1/spatial-correlation-sampler/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-p345xhjc/install-record.txt --single-version-externally-managed --compile --install-headers /home/cody/anaconda3/envs/pytracking/include/python3.7m/spatial-correlation-sampler Check the logs for full command output.(pytracking) cody@cody:~$ export CUDA_HOME=/usr/local/cuda-10.0(pytracking) cody@cody:~$ pip install spatial-correlation-sampler
Collecting spatial-correlation-samplerUsing cached spatial_correlation_sampler-0.2.1.tar.gz (8.2 kB)
Requirement already satisfied: torch>=1.1 in ./anaconda3/envs/pytracking/lib/python3.7/site-packages (from spatial-correlation-sampler) (1.3.1)
Requirement already satisfied: numpy in ./anaconda3/envs/pytracking/lib/python3.7/site-packages (from spatial-correlation-sampler) (1.19.1)
Building wheels for collected packages: spatial-correlation-samplerBuilding wheel for spatial-correlation-sampler (setup.py) ... doneCreated wheel for spatial-correlation-sampler: filename=spatial_correlation_sampler-0.2.1-cp37-cp37m-linux_x86_64.whl size=2027391 sha256=c2ff30e4d81d581d9455937f88317bdaf6054734765491ee5fd6771ecef4851cStored in directory: /home/cody/.cache/pip/wheels/c3/0e/10/4b97e589249d5fdfff11f472fc432de58713b25e10b3579ecd
Successfully built spatial-correlation-sampler
Installing collected packages: spatial-correlation-sampler
Successfully installed spatial-correlation-sampler-0.2.1

 

 


推荐阅读
  • 通过使用CIFAR-10数据集,本文详细介绍了如何快速掌握Mixup数据增强技术,并展示了该方法在图像分类任务中的显著效果。实验结果表明,Mixup能够有效提高模型的泛化能力和分类精度,为图像识别领域的研究提供了有价值的参考。 ... [详细]
  • 解决问题:1、批量读取点云las数据2、点云数据读与写出3、csf滤波分类参考:https:github.comsuyunzzzCSF论文题目ÿ ... [详细]
  • 在CentOS 7上部署WebRTC网关Janus
    在CentOS 7上部署WebRTC网关Janus ... [详细]
  • 浅析python实现布隆过滤器及Redis中的缓存穿透原理_python
    本文带你了解了位图的实现,布隆过滤器的原理及Python中的使用,以及布隆过滤器如何应对Redis中的缓存穿透,相信你对布隆过滤 ... [详细]
  • com.sun.javadoc.PackageDoc.exceptions()方法的使用及代码示例 ... [详细]
  • 解决Only fullscreen opaque activities can request orientation错误的方法
    本文介绍了在使用PictureSelectorLight第三方框架时遇到的Only fullscreen opaque activities can request orientation错误,并提供了一种有效的解决方案。 ... [详细]
  • 在多线程并发环境中,普通变量的操作往往是线程不安全的。本文通过一个简单的例子,展示了如何使用 AtomicInteger 类及其核心的 CAS 无锁算法来保证线程安全。 ... [详细]
  • Git命令基础应用指南
    本指南详细介绍了Git命令的基础应用,包括如何使用`git clone`从远程服务器克隆仓库(例如:`git clone [url/path/repository]`)以及如何克隆本地仓库(例如:`git clone [local/path/repository]`)。此外,还提供了常见的Git操作技巧,帮助开发者高效管理代码版本。 ... [详细]
  • 在对WordPress Duplicator插件0.4.4版本的安全评估中,发现其存在跨站脚本(XSS)攻击漏洞。此漏洞可能被利用进行恶意操作,建议用户及时更新至最新版本以确保系统安全。测试方法仅限于安全研究和教学目的,使用时需自行承担风险。漏洞编号:HTB23162。 ... [详细]
  • 在Conda环境中高效配置并安装PyTorch和TensorFlow GPU版的方法如下:首先,创建一个新的Conda环境以避免与基础环境发生冲突,例如使用 `conda create -n pytorch_gpu python=3.7` 命令。接着,激活该环境,确保所有依赖项都正确安装。此外,建议在安装过程中指定CUDA版本,以确保与GPU兼容性。通过这些步骤,可以确保PyTorch和TensorFlow GPU版的顺利安装和运行。 ... [详细]
  • 本文深入解析了WCF Binding模型中的绑定元素,详细介绍了信道、信道管理器、信道监听器和信道工厂的概念与作用。从对象创建的角度来看,信道管理器负责信道的生成。具体而言,客户端的信道通过信道工厂进行实例化,而服务端则通过信道监听器来接收请求。文章还探讨了这些组件之间的交互机制及其在WCF通信中的重要性。 ... [详细]
  • SSL 错误:目标主机名与备用证书主题名称不匹配
    在使用 `git clone` 命令时,常见的 SSL 错误表现为:无法访问指定的 HTTPS 地址(如 `https://ip_or_domain/xxxx.git`),原因是目标主机名与备用证书主题名称不匹配。这通常是因为服务器的 SSL 证书配置不正确或客户端的证书验证设置有问题。建议检查服务器的 SSL 证书配置,确保其包含正确的主机名,并确认客户端的证书信任库已更新。此外,可以通过临时禁用 SSL 验证来排查问题,但请注意这会降低安全性。 ... [详细]
  • 在开发过程中,我最初也依赖于功能全面但操作繁琐的集成开发环境(IDE),如Borland Delphi 和 Microsoft Visual Studio。然而,随着对高效开发的追求,我逐渐转向了更加轻量级和灵活的工具组合。通过 CLIfe,我构建了一个高度定制化的开发环境,不仅提高了代码编写效率,还简化了项目管理流程。这一配置结合了多种强大的命令行工具和插件,使我在日常开发中能够更加得心应手。 ... [详细]
  • 【图像分类实战】利用DenseNet在PyTorch中实现秃头识别
    本文详细介绍了如何使用DenseNet模型在PyTorch框架下实现秃头识别。首先,文章概述了项目所需的库和全局参数设置。接着,对图像进行预处理并读取数据集。随后,构建并配置DenseNet模型,设置训练和验证流程。最后,通过测试阶段验证模型性能,并提供了完整的代码实现。本文不仅涵盖了技术细节,还提供了实用的操作指南,适合初学者和有经验的研究人员参考。 ... [详细]
  • 基于Node.js的高性能实时消息推送系统通过集成Socket.IO和Express框架,实现了高效的高并发消息转发功能。该系统能够支持大量用户同时在线,并确保消息的实时性和可靠性,适用于需要即时通信的应用场景。 ... [详细]
author-avatar
润秋赋_137
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有