赞
踩
tx2_nx安装的是3261的bsp,jetpack4.6,python版本3.6.9
torch_version: 1.10.0
cuda_version: 10.2
cudnn_version: 8201
----------------------------------
True
device_count: 1
cuda:0
device_name: NVIDIA Tegra X2
tensor([[0.2731, 0.3814, 0.9734],
[0.3926, 0.0862, 0.3923],
[0.2319, 0.3595, 0.6996]], device='cuda:0')
CUDA available: True
cuDNN version: 8201
Tensor a = tensor([0., 0.], device='cuda:0')
Tensor b = tensor([-0.8535, -0.3004], device='cuda:0')
Tensor c = tensor([-0.8535, -0.3004], device='cuda:0')
0.11.0a0
安装过程饶了一大堆圈子,刚开始以为是QT的问题,opencv-python版本也没在意,以为是大于4.1.2就可以了。各种尝试开始了
qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.Aborted
资料贡献博主一估计也是没找到根源可以借鉴一下 这个方法,不显示界面,保存到文件夹下去打开
测试代码报错如上:以为是qt的问题
按照nvidia的论坛我还安装了QT 也算获得了一个新技能
In the end what worked for me (Jetson Nano 4GB) was:
(Source: PySide2 (Qt for python) installation on Jetson Xavier 34)
Download Qt source:
if you need the whole Qt5 (~900MB):
wget http://master.qt.io/archive/qt/5.15/5.15.2/single/qt-everywhere-src-5.15.2.tar.xz 19
or
qtbase (basic module such as QtCore, QtGui and QtWidget)(~90MB):
wget http://master.qt.io/archive/qt/5.15/5.15.2/submodules/qtbase-everywhere-src-5.15.2.tar.xz 8
configure and install Qt5 (here I used qtbase):
tar -xpf qtbase-everywhere-src-5.15.2.tar.xz
cd qtbase-everywhere-src-5.15.2/
./configure -xcb
(must enable xcb here manually)
Choose “o” to install Qt open source version.
make -j4
sudo make install
Also
- #If you don't configure the installation path, you need to create a link.
- sudo ln -sf /usr/local/Qt-5.15.2/bin/qmake /usr/lib/aarch64-linux-gnu/qt5/bin/qmake
意思是找不到xcb这个插件 ,然后去QT的安装路径下面找,我的是/usr/local/Qt-5.15.3/plugins/platforms,下面只有这几个lib,找到了libqxcb.so
- pip3 list
- Package Version
- ----------------------------- -------------------
- apt-clone 0.2.1
- apturl 0.5.2
- asn1crypto 0.24.0
- beautifulsoup4 4.6.0
- blinker 1.4
- Brlapi 0.6.6
- certifi 2022.9.24
- chardet 3.0.4
- charset-normalizer 2.0.12
- cppy 1.2.0
- cryptography 2.1.4
- cupshelpers 1.0
- cycler 0.11.0
- Cython 0.29.32
- dataclasses 0.8
- decorator 4.1.2
- defer 1.0.6
- distro 1.8.0
- distro-info 0.18ubuntu0.18.04.1
- feedparser 5.2.1
- graphsurgeon 0.4.5
- html5lib 0.999999999
- httplib2 0.9.2
- idna 3.4
- importlib-resources 5.4.0
- Jetson.GPIO 2.0.17
- jetson-stats 3.1.4
- keyring 10.6.0
- keyrings.alt 3.0
- kiwisolver 1.3.1
- language-selector 0.1
- launchpadlib 1.10.6
- lazr.restfulclient 0.13.5
- lazr.uri 1.0.3
- louis 3.5.0
- lxml 4.2.1
- macaroonbakery 1.1.3
- Mako 1.0.7
- MarkupSafe 1.0
- matplotlib 3.3.4
- numpy 1.19.5
- oauth 1.0.1
- oauthlib 2.0.6
- onboard 1.4.1
- opencv-python 4.5.5.64
- packaging 21.3
- PAM 0.4.2
- pandas 1.1.5
- Pillow 8.4.0
- pip 21.3.1
- protobuf 3.0.0
- pybind11 2.10.1
- pycairo 1.16.2
- pycrypto 2.6.1
- pycups 1.9.73
- PyGObject 3.26.1
- PyICU 1.9.8
- PyJWT 1.5.3
- pymacaroons 0.13.0
- PyNaCl 1.1.2
- pyparsing 3.0.9
- pyRFC3339 1.0
- python-apt 1.6.5+ubuntu0.6
- python-dateutil 2.8.2
- python-debian 0.1.32
- pytz 2018.3
- pyxattr 0.6.0
- pyxdg 0.25
- PyYAML 6.0
- requests 2.27.1
- requests-unixsocket 0.1.5
- scikit-build 0.16.2
- scipy 1.5.4
- seaborn 0.11.2
- SecretStorage 2.3.1
- setuptools 59.6.0
- simplejson 3.13.2
- sip 6.5.1
- six 1.16.0
- ssh-import-id 5.7
- system-service 0.3
- systemd-python 234
- tensorrt 8.0.1.6
- toml 0.10.2
- torch 1.10.0
- torchvision 0.11.0a0
- tqdm 4.64.1
- typing_extensions 4.1.1
- ubuntu-drivers-common 0.0.0
- uff 0.6.9
- unity-scope-calculator 0.1
- unity-scope-chromiumbookmarks 0.1
- unity-scope-colourlovers 0.1
- unity-scope-devhelp 0.1
- unity-scope-firefoxbookmarks 0.1
- unity-scope-manpages 0.1
- unity-scope-openclipart 0.1
- unity-scope-texdoc 0.1
- unity-scope-tomboy 0.1
- unity-scope-virtualbox 0.1
- unity-scope-yelp 0.1
- unity-scope-zotero 0.1
- urllib3 1.26.12
- urwid 2.0.1
- wadllib 1.3.2
- webencodings 0.5
- wheel 0.37.1
- xkit 0.0.0
- youtube_dl 2018.3.14
- zipp 3.6.0
- zope.interface 4.3.2
- nvidia@nvidia-desktop:~/yolov5-6.1$ pip in
翻阅资料以后找到如下方法,无奈又回到了起点,版本还是不对 ,pip3 install opencv-python4.3到4.5都安装了一遍,安装都失败了,4.5.5将就安装上也是下面的问题,给大家伙踩个雷,不要再跳坑了。
sudo pip3 --default-timeout=1000 install opencv-python-headless==4.5.5.64 -i https://pypi.tuna.tsinghua.edu.cn/simple
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
WARNING: The directory '/home/nvidia/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag.
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f85630978>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/opencv-python-headless/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f85630c88>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/opencv-python-headless/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f85628fd0>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/opencv-python-headless/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f85628c18>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/opencv-python-headless/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f85628a90>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/opencv-python-headless/
Collecting opencv-python-headless==4.5.5.64
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/43/03/13447b012f11ed59948a1f09fc791bd2fbc32afca11a49eea75a4e683d1d/opencv_python_headless-4.5.5.64-cp36-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (26.7 MB)
|████████████████████████████████| 26.7 MB 830 kB/s
Requirement already satisfied: numpy>=1.19.3 in /home/nvidia/.local/lib/python3.6/site-packages (from opencv-python-headless==4.5.5.64) (1.19.5)
Installing collected packages: opencv-python-headless
Successfully installed opencv-python-headless-4.5.5.64
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
nvidia@nvidia-desktop:~/yolov5-6.1$ sudo python3 detect.py --weights yolov5s.pt --source data/images/zidane.jpg --view-img
detect: weights=['yolov5s.pt'], source=data/images/zidane.jpg, data=data/coco128.yaml, imgsz=[640, 640], conf_thres=0.25, iou_thres=0.45, max_det=1000, device=, view_img=True, save_txt=False, save_conf=False, save_crop=False, nosave=False, classes=None, agnostic_nms=False, augment=False, visualize=False, update=False, project=runs/detect, name=exp, exist_ok=False, line_thickness=3, hide_labels=False, hide_conf=False, half=False, dnn=False
YOLOv5声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小小林熬夜学编程/article/detail/218713
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。