热门标签 | 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

 

 


推荐阅读
  • 树莓派语音控制的配置方法和步骤
    本文介绍了在树莓派上实现语音控制的配置方法和步骤。首先感谢博主Eoman的帮助,文章参考了他的内容。树莓派的配置需要通过sudo raspi-config进行,然后使用Eoman的控制方法,即安装wiringPi库并编写控制引脚的脚本。具体的安装步骤和脚本编写方法在文章中详细介绍。 ... [详细]
  • Centos7.6安装Gitlab教程及注意事项
    本文介绍了在Centos7.6系统下安装Gitlab的详细教程,并提供了一些注意事项。教程包括查看系统版本、安装必要的软件包、配置防火墙等步骤。同时,还强调了使用阿里云服务器时的特殊配置需求,以及建议至少4GB的可用RAM来运行GitLab。 ... [详细]
  • 本文介绍了在Ubuntu系统中清理残余配置文件和无用内容的方法,包括清理残余配置文件、清理下载缓存包、清理不再需要的包、清理无用的语言文件和清理无用的翻译内容。通过这些清理操作可以节省硬盘空间,提高系统的运行效率。 ... [详细]
  • imx6ull开发板驱动MT7601U无线网卡的方法和步骤详解
    本文详细介绍了在imx6ull开发板上驱动MT7601U无线网卡的方法和步骤。首先介绍了开发环境和硬件平台,然后说明了MT7601U驱动已经集成在linux内核的linux-4.x.x/drivers/net/wireless/mediatek/mt7601u文件中。接着介绍了移植mt7601u驱动的过程,包括编译内核和配置设备驱动。最后,列举了关键词和相关信息供读者参考。 ... [详细]
  • 31.项目部署
    目录1一些概念1.1项目部署1.2WSGI1.3uWSGI1.4Nginx2安装环境与迁移项目2.1项目内容2.2项目配置2.2.1DEBUG2.2.2STAT ... [详细]
  • 本文介绍了解决github无法访问和克隆项目到本地的问题。作者建议通过修改配置文件中的用户名和密码来解决访问失败的问题,并提供了详细步骤。同时,还提醒读者注意输入的用户名和密码是否正确。 ... [详细]
  • 本文介绍了在Ubuntu下制作deb安装包及离线安装包的方法,通过备份/var/cache/apt/archives文件夹中的安装包,并建立包列表及依赖信息文件,添加本地源,更新源列表,可以在没有网络的情况下更新系统。同时提供了命令示例和资源下载链接。 ... [详细]
  • 本文介绍了在Android Studio中使用命令行build gradle的方法,并解决了一些常见问题,包括手动配置gradle环境变量和解决External Native Build Issues的方法。同时提供了相关参考文章链接。 ... [详细]
  • Python教学练习二Python1-12练习二一、判断季节用户输入月份,判断这个月是哪个季节?3,4,5月----春 ... [详细]
  • 初探PLC 的ST 语言转换成C++ 的方法
    自动控制软件绕不开ST(StructureText)语言。它是IEC61131-3标准中唯一的一个高级语言。目前,大多数PLC产品支持ST ... [详细]
  • 使用Ubuntu中的Python获取浏览器历史记录原文: ... [详细]
  • 本文介绍了三种方法来实现在Win7系统中显示桌面的快捷方式,包括使用任务栏快速启动栏、运行命令和自己创建快捷方式的方法。具体操作步骤详细说明,并提供了保存图标的路径,方便以后使用。 ... [详细]
  • 本文介绍了在mac环境下使用nginx配置nodejs代理服务器的步骤,包括安装nginx、创建目录和文件、配置代理的域名和日志记录等。 ... [详细]
  • Android实战——jsoup实现网络爬虫,糗事百科项目的起步
    本文介绍了Android实战中使用jsoup实现网络爬虫的方法,以糗事百科项目为例。对于初学者来说,数据源的缺乏是做项目的最大烦恼之一。本文讲述了如何使用网络爬虫获取数据,并以糗事百科作为练手项目。同时,提到了使用jsoup需要结合前端基础知识,以及如果学过JS的话可以更轻松地使用该框架。 ... [详细]
  • Jquery 跨域问题
    为什么80%的码农都做不了架构师?JQuery1.2后getJSON方法支持跨域读取json数据,原理是利用一个叫做jsonp的概念。当然 ... [详细]
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社区 版权所有