当前位置:   article > 正文

Jeton TX2_NX(Jetpack4.6)部署Yolo5错误整理记录qt.qpa.plugin: Could not find the Qt platform plugin “xcb“ in_tx2跑yolo5被杀死

tx2跑yolo5被杀死

 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的问题 

qt下程序运行问题贡献博主

nvidia论坛贡献Getting Error in Jetson Xavier -> qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in "" - Jetson & Embedded Systems / Jetson Xavier NX - NVIDIA Developer Forums

按照nvidia的论坛我还安装了QT 也算获得了一个新技能

In the end what worked for me (Jetson Nano 4GB) was:

(Source: PySide2 (Qt for python) installation on Jetson Xavier 34)

  1. 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

  2. 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

  1. Now we have Qt5 under /usr/local/Qt-5.15.2

Also

  1. #If you don't configure the installation path, you need to create a link.
  2. 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 

  1. pip3 list
  2. Package Version
  3. ----------------------------- -------------------
  4. apt-clone 0.2.1
  5. apturl 0.5.2
  6. asn1crypto 0.24.0
  7. beautifulsoup4 4.6.0
  8. blinker 1.4
  9. Brlapi 0.6.6
  10. certifi 2022.9.24
  11. chardet 3.0.4
  12. charset-normalizer 2.0.12
  13. cppy 1.2.0
  14. cryptography 2.1.4
  15. cupshelpers 1.0
  16. cycler 0.11.0
  17. Cython 0.29.32
  18. dataclasses 0.8
  19. decorator 4.1.2
  20. defer 1.0.6
  21. distro 1.8.0
  22. distro-info 0.18ubuntu0.18.04.1
  23. feedparser 5.2.1
  24. graphsurgeon 0.4.5
  25. html5lib 0.999999999
  26. httplib2 0.9.2
  27. idna 3.4
  28. importlib-resources 5.4.0
  29. Jetson.GPIO 2.0.17
  30. jetson-stats 3.1.4
  31. keyring 10.6.0
  32. keyrings.alt 3.0
  33. kiwisolver 1.3.1
  34. language-selector 0.1
  35. launchpadlib 1.10.6
  36. lazr.restfulclient 0.13.5
  37. lazr.uri 1.0.3
  38. louis 3.5.0
  39. lxml 4.2.1
  40. macaroonbakery 1.1.3
  41. Mako 1.0.7
  42. MarkupSafe 1.0
  43. matplotlib 3.3.4
  44. numpy 1.19.5
  45. oauth 1.0.1
  46. oauthlib 2.0.6
  47. onboard 1.4.1
  48. opencv-python 4.5.5.64
  49. packaging 21.3
  50. PAM 0.4.2
  51. pandas 1.1.5
  52. Pillow 8.4.0
  53. pip 21.3.1
  54. protobuf 3.0.0
  55. pybind11 2.10.1
  56. pycairo 1.16.2
  57. pycrypto 2.6.1
  58. pycups 1.9.73
  59. PyGObject 3.26.1
  60. PyICU 1.9.8
  61. PyJWT 1.5.3
  62. pymacaroons 0.13.0
  63. PyNaCl 1.1.2
  64. pyparsing 3.0.9
  65. pyRFC3339 1.0
  66. python-apt 1.6.5+ubuntu0.6
  67. python-dateutil 2.8.2
  68. python-debian 0.1.32
  69. pytz 2018.3
  70. pyxattr 0.6.0
  71. pyxdg 0.25
  72. PyYAML 6.0
  73. requests 2.27.1
  74. requests-unixsocket 0.1.5
  75. scikit-build 0.16.2
  76. scipy 1.5.4
  77. seaborn 0.11.2
  78. SecretStorage 2.3.1
  79. setuptools 59.6.0
  80. simplejson 3.13.2
  81. sip 6.5.1
  82. six 1.16.0
  83. ssh-import-id 5.7
  84. system-service 0.3
  85. systemd-python 234
  86. tensorrt 8.0.1.6
  87. toml 0.10.2
  88. torch 1.10.0
  89. torchvision 0.11.0a0
  90. tqdm 4.64.1
  91. typing_extensions 4.1.1
  92. ubuntu-drivers-common 0.0.0
  93. uff 0.6.9
  94. unity-scope-calculator 0.1
  95. unity-scope-chromiumbookmarks 0.1
  96. unity-scope-colourlovers 0.1
  97. unity-scope-devhelp 0.1
  98. unity-scope-firefoxbookmarks 0.1
  99. unity-scope-manpages 0.1
  100. unity-scope-openclipart 0.1
  101. unity-scope-texdoc 0.1
  102. unity-scope-tomboy 0.1
  103. unity-scope-virtualbox 0.1
  104. unity-scope-yelp 0.1
  105. unity-scope-zotero 0.1
  106. urllib3 1.26.12
  107. urwid 2.0.1
  108. wadllib 1.3.2
  109. webencodings 0.5
  110. wheel 0.37.1
  111. xkit 0.0.0
  112. youtube_dl 2018.3.14
  113. zipp 3.6.0
  114. zope.interface 4.3.2
  115. 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
推荐阅读
相关标签