1.源码下载
jetson@jetson-desktop:~/torch$ git clone https://github.com/WongKinYiu/yolov7.git
Cloning into 'yolov7'...
remote: Enumerating objects: 1139, done.
remote: Total 1139 (delta 0), reused 0 (delta 0), pack-reused 1139
Receiving objects: 100% (1139/1139), 70.41 MiB | 1.07 MiB/s, done.
Resolving deltas: 100% (488/488), done.
jetson@jetson-desktop:~/torch$
2.安装依赖
jetson@jetson-desktop:~/torch/yolov7$ pip install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt
3,将之前训练好的权重文件复制到yolov7文件夹下
4.进行视频检测
jetson@jetson-desktop:~/torch/yolov7$ python3 detect.py --weights best.pt --conf 0.25 --img-size 640 --source ../yolov5/daming.mp4
5.安装错误
错误
(pytorch) jetson@ubuntu:~/torch/yolov7$ pip install 'matplotlib>=3.2.2' -i https://pypi.mirrors.ustc.edu.cn/simple
Looking in indexes: https://pypi.mirrors.ustc.edu.cn/simple
Collecting matplotlib>=3.2.2
Using cached https://mirrors.bfsu.edu.cn/pypi/web/packages/22/d4/e7ca532e68a9357742604e1e4ae35d9c09a4a810de39a9d80402bd12f50f/matplotlib-3.3.4.tar.gz (37.9 MB)
Preparing metadata (setup.py) ... error
ERROR: Command errored out with exit status -4:
command: /home/jetson/.conda/envs/pytorch/bin/python3.6 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-rgakv58b/matplotlib_d00969034f8440b88023b70dce49d337/setup.py'"'"'; __file__='"'"'/tmp/pip-install-rgakv58b/matplotlib_d00969034f8440b88023b70dce49d337/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-dott7uow
cwd: /tmp/pip-install-rgakv58b/matplotlib_d00969034f8440b88023b70dce49d337/
Complete output (20 lines):
Edit setup.cfg to change the build options; suppress output with --quiet.
BUILDING MATPLOTLIB
matplotlib: yes [3.3.4]
python: yes [3.6.15 | packaged by conda-forge | (default, Dec 3 2021,
19:12:04) [GCC 9.4.0]]
platform: yes [linux]
sample_data: yes [installing]
tests: no [skipping due to configuration]
macosx: no [Mac OS-X only]
running egg_info
creating /tmp/pip-pip-egg-info-dott7uow/matplotlib.egg-info
writing /tmp/pip-pip-egg-info-dott7uow/matplotlib.egg-info/PKG-INFO
writing dependency_links to /tmp/pip-pip-egg-info-dott7uow/matplotlib.egg-info/dependency_links.txt
writing namespace_packages to /tmp/pip-pip-egg-info-dott7uow/matplotlib.egg-info/namespace_packages.txt
writing requirements to /tmp/pip-pip-egg-info-dott7uow/matplotlib.egg-info/requires.txt
writing top-level names to /tmp/pip-pip-egg-info-dott7uow/matplotlib.egg-info/top_level.txt
writing manifest file '/tmp/pip-pip-egg-info-dott7uow/matplotlib.egg-info/SOURCES.txt'
----------------------------------------
WARNING: Discarding https://mirrors.bfsu.edu.cn/pypi/web/packages/22/d4/e7ca532e68a9357742604e1e4ae35d9c09a4a810de39a9d80402bd12f50f/matplotlib-3.3.4.tar.gz#sha256=3e477db76c22929e4c6876c44f88d790aacdf3c3f8f3a90cb1975c0bf37825b0 (from https://mirrors.bfsu.edu.cn/pypi/web/simple/matplotlib/) (requires-python:>=3.6). Command errored out with exit status -4: python setup.py egg_info Check the logs for full command output.
Using cached https://mirrors.bfsu.edu.cn/pypi/web/packages/7b/b3/7c48f648bf83f39d4385e0169d1b68218b838e185047f7f613b1cfc57947/matplotlib-3.3.3.tar.gz (37.9 MB)
Preparing metadata (setup.py) ... error
ERROR: Command errored out with exit status -4:
command: /home/jetson/.conda/envs/pytorch/bin/python3.6 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-rgakv58b/matplotlib_f349c5085ff746c58feef09efe236c6f/setup.py'"'"'; __file__='"'"'/tmp/pip-install-rgakv58b/matplotlib_f349c5085ff746c58feef09efe236c6f/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-ze7pu4dt
cwd: /tmp/pip-install-rgakv58b/matplotlib_f349c5085ff746c58feef09efe236c6f/
Complete output (20 lines):
Edit setup.cfg to change the build options; suppress output with --quiet.
BUILDING MATPLOTLIB
matplotlib: yes [3.3.3]
python: yes [3.6.15 | packaged by conda-forge | (default, Dec 3 2021,
19:12:04) [GCC 9.4.0]]
platform: yes [linux]
sample_data: yes [installing]
tests: no [skipping due to configuration]
macosx: no [Mac OS-X only]
running egg_info
creating /tmp/pip-pip-egg-info-ze7pu4dt/matplotlib.egg-info
writing /tmp/pip-pip-egg-info-ze7pu4dt/matplotlib.egg-info/PKG-INFO
writing dependency_links to /tmp/pip-pip-egg-info-ze7pu4dt/matplotlib.egg-info/dependency_links.txt
writing namespace_packages to /tmp/pip-pip-egg-info-ze7pu4dt/matplotlib.egg-info/namespace_packages.txt
writing requirements to /tmp/pip-pip-egg-info-ze7pu4dt/matplotlib.egg-info/requires.txt
writing top-level names to /tmp/pip-pip-egg-info-ze7pu4dt/matplotlib.egg-info/top_level.txt
writing manifest file '/tmp/pip-pip-egg-info-ze7pu4dt/matplotlib.egg-info/SOURCES.txt'
----------------------------------------
WARNING: Discarding https://mirrors.bfsu.edu.cn/pypi/web/packages/7b/b3/7c48f648bf83f39d4385e0169d1b68218b838e185047f7f613b1cfc57947/matplotlib-3.3.3.tar.gz#sha256=b1b60c6476c4cfe9e5cf8ab0d3127476fd3d5f05de0f343a452badaad0e4bdec (from https://mirrors.bfsu.edu.cn/pypi/web/simple/matplotlib/) (requires-python:>=3.6). Command errored out with exit status -4: python setup.py egg_info Check the logs for full command output.
Using cached https://mirrors.bfsu.edu.cn/pypi/web/packages/2b/4c/fe4b36325795524f35d39edc390c89584e9a901df9e615df6f5effddaa0e/matplotlib-3.3.2.tar.gz (37.9 MB)
Preparing metadata (setup.py) ... error
ERROR: Command errored out with exit status -4:
command: /home/jetson/.conda/envs/pytorch/bin/python3.6 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-rgakv58b/matplotlib_9963c48e2a3145628fd7c8c0f94e07a1/setup.py'"'"'; __file__='"'"'/tmp/pip-install-rgakv58b/matplotlib_9963c48e2a3145628fd7c8c0f94e07a1/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-28oolve7
cwd: /tmp/pip-install-rgakv58b/matplotlib_9963c48e2a3145628fd7c8c0f94e07a1/
Complete output (20 lines):
Edit setup.cfg to change the build options; suppress output with --quiet.
BUILDING MATPLOTLIB
matplotlib: yes [3.3.2]
python: yes [3.6.15 | packaged by conda-forge | (default, Dec 3 2021,
19:12:04) [GCC 9.4.0]]
platform: yes [linux]
sample_data: yes [installing]
tests: no [skipping due to configuration]
macosx: no [Mac OS-X only]
running egg_info
creating /tmp/pip-pip-egg-info-28oolve7/matplotlib.egg-info
writing /tmp/pip-pip-egg-info-28oolve7/matplotlib.egg-info/PKG-INFO
writing dependency_links to /tmp/pip-pip-egg-info-28oolve7/matplotlib.egg-info/dependency_links.txt
writing namespace_packages to /tmp/pip-pip-egg-info-28oolve7/matplotlib.egg-info/namespace_packages.txt
writing requirements to /tmp/pip-pip-egg-info-28oolve7/matplotlib.egg-info/requires.txt
writing top-level names to /tmp/pip-pip-egg-info-28oolve7/matplotlib.egg-info/top_level.txt
writing manifest file '/tmp/pip-pip-egg-info-28oolve7/matplotlib.egg-info/SOURCES.txt'
----------------------------------------
WARNING: Discarding https://mirrors.bfsu.edu.cn/pypi/web/packages/2b/4c/fe4b36325795524f35d39edc390c89584e9a901df9e615df6f5effddaa0e/matplotlib-3.3.2.tar.gz#sha256=3d2edbf59367f03cd9daf42939ca06383a7d7803e3993eb5ff1bee8e8a3fbb6b (from https://mirrors.bfsu.edu.cn/pypi/web/simple/matplotlib/) (requires-python:>=3.6). Command errored out with exit status -4: python setup.py egg_info Check the logs for full command output.
Using cached https://mirrors.bfsu.edu.cn/pypi/web/packages/58/bd/d3b13e93c01226901ceb50a14c110b5722f446e456f7f4fd7fd231b33742/matplotlib-3.3.1.tar.gz (38.8 MB)
Preparing metadata (setup.py) ... error
ERROR: Command errored out with exit status -4:
command: /home/jetson/.conda/envs/pytorch/bin/python3.6 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-rgakv58b/matplotlib_c8e38d86959d4d42b64960c33c6bcd71/setup.py'"'"'; __file__='"'"'/tmp/pip-install-rgakv58b/matplotlib_c8e38d86959d4d42b64960c33c6bcd71/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-fu4w53cb
cwd: /tmp/pip-install-rgakv58b/matplotlib_c8e38d86959d4d42b64960c33c6bcd71/
Complete output (20 lines):
Edit setup.cfg to change the build options; suppress output with --quiet.
BUILDING MATPLOTLIB
matplotlib: yes [3.3.1]
python: yes [3.6.15 | packaged by conda-forge | (default, Dec 3 2021,
19:12:04) [GCC 9.4.0]]
platform: yes [linux]
sample_data: yes [installing]
tests: no [skipping due to configuration]
macosx: no [Mac OS-X only]
running egg_info
creating /tmp/pip-pip-egg-info-fu4w53cb/matplotlib.egg-info
writing /tmp/pip-pip-egg-info-fu4w53cb/matplotlib.egg-info/PKG-INFO
writing dependency_links to /tmp/pip-pip-egg-info-fu4w53cb/matplotlib.egg-info/dependency_links.txt
writing namespace_packages to /tmp/pip-pip-egg-info-fu4w53cb/matplotlib.egg-info/namespace_packages.txt
writing requirements to /tmp/pip-pip-egg-info-fu4w53cb/matplotlib.egg-info/requires.txt
writing top-level names to /tmp/pip-pip-egg-info-fu4w53cb/matplotlib.egg-info/top_level.txt
writing manifest file '/tmp/pip-pip-egg-info-fu4w53cb/matplotlib.egg-info/SOURCES.txt'
----------------------------------------
WARNING: Discarding https://mirrors.bfsu.edu.cn/pypi/web/packages/58/bd/d3b13e93c01226901ceb50a14c110b5722f446e456f7f4fd7fd231b33742/matplotlib-3.3.1.tar.gz#sha256=87f53bcce90772f942c2db56736788b39332d552461a5cb13f05ff45c1680f0e (from https://mirrors.bfsu.edu.cn/pypi/web/simple/matplotlib/) (requires-python:>=3.6). Command errored out with exit status -4: python setup.py egg_info Check the logs for full command output.
Using cached https://mirrors.bfsu.edu.cn/pypi/web/packages/7d/d4/e4c40c62cd8608ca09f0684e64139c56512e195f2351ac41a472d4dc8b38/matplotlib-3.3.0.tar.gz (38.8 MB)
^CERROR: Operation cancelled by user
(pytorch) jetson@ubuntu:~/torch/yolov7$
使用conda 安装
(pytorch) jetson@ubuntu:~/torch/yolov7$ conda install 'matplotlib>=3.2.2'
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: done
==> WARNING: A newer version of conda exists. <==
current version: 23.1.0
latest version: 23.3.1
Please update conda by running
$ conda update -n base -c conda-forge conda
Or to minimize the number of packages updated during conda update use
conda install conda=23.3.1
## Package Plan ##
environment location: /home/jetson/.conda/envs/pytorch
added / updated specs:
- matplotlib[version='>=3.2.2']
The following packages will be downloaded:
package | build
---------------------------|-----------------
certifi-2021.5.30 | py36h704843e_0 141 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
cycler-0.11.0 | pyhd8ed1ab_0 10 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
freetype-2.12.1 | hbbbf32d_1 624 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
jpeg-9e | h2a766a3_3 316 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
kiwisolver-1.3.1 | py36h72e8208_1 79 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
lcms2-2.12 | h012adcb_0 524 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
lerc-3.0 | h01db608_0 200 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
libblas-3.9.0 |16_linuxaarch64_openblas 13 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
libcblas-3.9.0 |16_linuxaarch64_openblas 13 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
libdeflate-1.10 | hf897c2e_0 100 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
libgfortran-ng-12.2.0 | he9431aa_19 22 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
libgfortran5-12.2.0 | hf695500_19 1.3 MB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
liblapack-3.9.0 |16_linuxaarch64_openblas 13 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
libopenblas-0.3.21 |pthreads_h6cb6f83_3 7.2 MB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
libpng-1.6.39 | hf9034f9_0 292 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
libtiff-4.3.0 | h8ba47be_4 740 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
libwebp-base-1.3.0 | hb4cce97_0 350 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
matplotlib-3.3.4 | py36h704843e_0 6 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
matplotlib-base-3.3.4 | py36hf6608de_0 6.8 MB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
numpy-1.19.5 | py36hdc1b780_1 5.4 MB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
olefile-0.46 | pyh9f0ad1d_1 32 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
openjpeg-2.5.0 | h9b6de37_0 596 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
pillow-8.3.2 | py36he1c1ed0_0 696 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
pyparsing-3.0.9 | pyhd8ed1ab_0 79 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
python-dateutil-2.8.2 | pyhd8ed1ab_0 240 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
six-1.16.0 | pyh6c4a22f_0 14 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
tornado-6.1 | py36h269c3a8_1 644 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
zlib-1.2.13 | h4e544f5_4 98 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
zstd-1.5.2 | h44f6412_6 390 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
------------------------------------------------------------
Total: 26.7 MB
The following NEW packages will be INSTALLED:
certifi anaconda/cloud/conda-forge/linux-aarch64::certifi-2021.5.30-py36h704843e_0
cycler anaconda/cloud/conda-forge/noarch::cycler-0.11.0-pyhd8ed1ab_0
freetype anaconda/cloud/conda-forge/linux-aarch64::freetype-2.12.1-hbbbf32d_1
jpeg anaconda/cloud/conda-forge/linux-aarch64::jpeg-9e-h2a766a3_3
kiwisolver anaconda/cloud/conda-forge/linux-aarch64::kiwisolver-1.3.1-py36h72e8208_1
lcms2 anaconda/cloud/conda-forge/linux-aarch64::lcms2-2.12-h012adcb_0
lerc anaconda/cloud/conda-forge/linux-aarch64::lerc-3.0-h01db608_0
libblas anaconda/cloud/conda-forge/linux-aarch64::libblas-3.9.0-16_linuxaarch64_openblas
libcblas anaconda/cloud/conda-forge/linux-aarch64::libcblas-3.9.0-16_linuxaarch64_openblas
libdeflate anaconda/cloud/conda-forge/linux-aarch64::libdeflate-1.10-hf897c2e_0
libgfortran-ng anaconda/cloud/conda-forge/linux-aarch64::libgfortran-ng-12.2.0-he9431aa_19
libgfortran5 anaconda/cloud/conda-forge/linux-aarch64::libgfortran5-12.2.0-hf695500_19
liblapack anaconda/cloud/conda-forge/linux-aarch64::liblapack-3.9.0-16_linuxaarch64_openblas
libopenblas anaconda/cloud/conda-forge/linux-aarch64::libopenblas-0.3.21-pthreads_h6cb6f83_3
libpng anaconda/cloud/conda-forge/linux-aarch64::libpng-1.6.39-hf9034f9_0
libtiff anaconda/cloud/conda-forge/linux-aarch64::libtiff-4.3.0-h8ba47be_4
libwebp-base anaconda/cloud/conda-forge/linux-aarch64::libwebp-base-1.3.0-hb4cce97_0
matplotlib anaconda/cloud/conda-forge/linux-aarch64::matplotlib-3.3.4-py36h704843e_0
matplotlib-base anaconda/cloud/conda-forge/linux-aarch64::matplotlib-base-3.3.4-py36hf6608de_0
numpy anaconda/cloud/conda-forge/linux-aarch64::numpy-1.19.5-py36hdc1b780_1
olefile anaconda/cloud/conda-forge/noarch::olefile-0.46-pyh9f0ad1d_1
openjpeg anaconda/cloud/conda-forge/linux-aarch64::openjpeg-2.5.0-h9b6de37_0
pillow anaconda/cloud/conda-forge/linux-aarch64::pillow-8.3.2-py36he1c1ed0_0
pyparsing anaconda/cloud/conda-forge/noarch::pyparsing-3.0.9-pyhd8ed1ab_0
python-dateutil anaconda/cloud/conda-forge/noarch::python-dateutil-2.8.2-pyhd8ed1ab_0
six anaconda/cloud/conda-forge/noarch::six-1.16.0-pyh6c4a22f_0
tornado anaconda/cloud/conda-forge/linux-aarch64::tornado-6.1-py36h269c3a8_1
zlib anaconda/cloud/conda-forge/linux-aarch64::zlib-1.2.13-h4e544f5_4
zstd anaconda/cloud/conda-forge/linux-aarch64::zstd-1.5.2-h44f6412_6
Proceed ([y]/n)? y
Downloading and Extracting Packages
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
(pytorch) jetson@ubuntu:~