1.Windows系统下的环境配置:win11+wsl2 (ubuntu20.04)

介绍:wsl (windows subsystem for linux):即windows系统的子系统,直接连接硬件。且不影响windows系统,具体配置方法。

(1) 任务栏搜索:启动或关机windows功能勾选适用于Linux的Windows子系统(重启电脑)

注:重启电脑后再次进入该界面检查

并更新WSL : 

在windows终端输入 wsl.exe --update

(2)安装方法:打开windows自带的应用商店,搜索ubuntu,选择版本后自己打开

参考视频:第一章-08-扩展-Win10配置WSL(Ubuntu)环境_哔哩哔哩_bilibili

注:安装可能会报错(系统找不到指定的文件。 Press any key to continue...),我是将源程序卸载后关机重启,并将安装位置选择在了其它盘后,问题解决。

注:我想将ubuntu系统存储至单独的硬盘中,在存储中存储至其它盘

(3)直接打开安装好的应用

(4)进入如下界面表示安装成功,该界面表示给ubuntu系统起一个用户名

输入用户名后回车

创建初始的系统密码,输入后系统不显示直接回车

输入后系统不显示直接回车后,再次输入密码确认

(5)在任意界面进入《在终端打开 》即windows terminal,win11自带,win10需要去应用商店下载

(6)进入后在右上角可选择ubuntu,快速进入系统

(7)在终端输入 wsl --list --verbose 检查version 若为2则表示wsl2

2.配置ubuntu系统环境

参考:深度学习:wsl ubuntu安装cuda和cudnn_哔哩哔哩_bilibili

        由于wsl和windows共用显卡驱动,因此仅需要安装cidatoolkit和cudnn,conda命令安装后虽然也可以用cudnn,但是不是完整版,不能编译。如果需要编译功能,还是需要安装完整版本的cudatoolkit。同时由于需要TensorRT与cuda,以及cudnn完全对应,因此需要根据TensorRT的版本去安装对应的cuda与cudnn,本文想使用

(1)(根据项目要求选择合适的TensorRT版本,本文是要做BEVF实验,因此TensorRT选择的版本为8.5.1,BEVF实验项目链接:Lidar_AI_Solution/CUDA-BEVFusion at master · NVIDIA-AI-IOT/Lidar_AI_Solution · GitHubhttps://github.com/NVIDIA-AI-IOT/Lidar_AI_Solution/tree/master/CUDA-BEVFusion

TensorRT下载地址:NVIDIA TensorRT 8.x Download | NVIDIA Developerhttps://developer.nvidia.com/nvidia-tensorrt-8x-download,

其中GA表示稳定版本,由于本文在WSL2-ubuntu22.04版本下运行因此选择第二个

下载该版本的TensorRT并查看对应的cudnn版本与cuda版本

        

(2)根据要求TensorRT要求cuda的最高版本为11.8,本文电脑最高支持的cuda版本为12.4

本文安装cuda11.7,CUDA Toolkit Archive | NVIDIA Developer

(3)下载cuDNN

TensorRT所需要的各个软件版本要去官网找一下:Release Notes :: NVIDIA Deep Learning TensorRT Documentationhttps://docs.nvidia.com/deeplearning/tensorrt/archives/tensorrt-1070/release-notes/index.html#rel-8-5-3

本文所需的cuDNN版本为 8.6.0,去cuDNN网站下载对应的软件版本(对应CUDA版本):cuDNN Archive | NVIDIA Developerhttps://developer.nvidia.com/rdp/cudnn-archive

本文下载的安装包为:

   (4)下载完成后可将该文件拷贝至home目录下

(5)安装顺序为CUDA ,cuDNN,TensorRT

CUDA安装:CUDA Toolkit 11.7 Downloads | NVIDIA Developerhttps://developer.nvidia.com/cuda-11-7-0-download-archive?target_os=Linux&target_arch=x86_64&Distribution=WSL-Ubuntu&target_version=2.0&target_type=deb_local

安装完成后,输入nvcc -V指令发现报错,此时要在环境变量中添加包

①首先: sudo nano ~/.bashrc

②将以下内容添加进文件最后:

export PATH=/usr/local/cuda-11.7/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-11.7/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

注:将cuda-11.7改为自己安装的cuda版本

③保存退出后(Ctrl+x),更新一下环境变量:

source ~/.bashrc
再次输入程序 nvcc -V显示以下画面证实安装成功:

(6)cuDNN安装步骤:

①将下载好的cudnn安装包解压

sudo tar -xvf 包名

sudo tar -xvf cudnn-linux-x86_64-8.6.0.163_cuda11-archive.tar.xz

②然后把解压得到的文件分别拷贝到对应的文件夹(注意,下面命令中的 /lib/和/include/ 指的是刚刚解压得到的文件夹里的):

进入刚刚解压的文件夹当中lib:

输入指令1:将lib中的文件全部拷贝到cuda11.7中的lib64文件当中

sudo cp -r * /usr/local/cuda-11.7/lib64

③退出文件,进入include文件中

输入指令2:拷贝include文件中的所有文件

sudo cp -r * /usr/local/cuda-11.7/include

④输入指令:更改文件权限

sudo chmod a+r /usr/local/cuda-11.7/include/cudnn*
sudo chmod a+r /usr/local/cuda-11.7/lib64/libcudnn*

⑤输入指令:检查cuDNN是否安装成功

cat /usr/local/cuda-11.7/include/cudnn_version.h | grep CUDNN_MAJOR -A 2

下图表示安装成功

(7)TensorRT安装步骤:

①解压tensorRT文件

tar -xzvf TensorRT-8.5.1.7.Linux.x86_64-gnu.cuda-11.8.cudnn8.6.tar.gz

②添加环境变量

进入该文件

 sudo nano ~/.bashrc

将以下内容添加进文件最后

export PATH="/home/u22045/packages/TensorRT-8.5.1.7/bin:$PATH"
export LD_LIBRARY_PATH="/home/u22045/packages/TensorRT-8.5.1.7/lib:$LD_LIBRARY_PATH"

保存退出后(Ctrl+x),更新一下环境变量:

source ~/.bashrc

③执行trtexec显示如下界面即为正确

注:文件路径写错了会显示 trtexec: command not found

(8)推理tensorRT中的例子

cd samples/

cd sampleOnnxMNIST/

make -j16

cd ../../bin/

./sample_onnx_mnist

报错:Could not load library libcudnn_cnn_infer.so.8. Error: libcuda.so: cannot open shared object file: No such file or directory

解决方法:【已解决】Could not load library libcudnn_cnn_infer.so.8._[error] [omni.physx.plugin] physx error: could not-CSDN博客

①source ~/.bashrc

②在文件末尾处添加:

export LD_LIBRARY_PATH=/usr/lib/wsl/lib:$LD_LIBRARY_PATH

③source ~/.bashrc

④再次运行

./sample_onnx_mnist

安装成功

3. opencv安装

【环境配置】Windows 11 的 WSL(Ubuntu2204) 安装OpenCV 4.5.4 (亲测有效)_wsl opencv-CSDN博客https://blog.csdn.net/zhoujinwang/article/details/127741366

报错1:

u22045@LJJ:~$ sudo apt install python-dev python-numpy libtbb2 libtbb-dev libpng-dev libjasper-dev libdc1394-22-dev
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package python-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  python2-dev python2 python-dev-is-python3

①E: Package 'python-dev' has no installation candidate
②E: Unable to locate package python-numpy
③E: Unable to locate package libjasper-dev
④E: Unable to locate package libdc1394-22-dev

①解决方法:sudo apt install python3-dev,后继续报错/sbin/ldconfig.real: Can't link /usr/lib/wsl/lib/libnvoptix_loader.so.1 to libnvoptix.so.1

解决方法:windows下wsl(ubuntu)ldconfig报错_ldconfig.real-CSDN博客https://blog.csdn.net/qq_47564006/article/details/135056558

②sudo apt install python3-numpy

注:把其它包安装,sudo apt install libtbb2 libtbb-dev libpng-dev

③和④

解决一:
sudo vim /etc/apt/sources.list
最后一行加入如下内容并保存退出:
deb http://security.ubuntu.com/ubuntu xenial-security main

再执行:
sudo apt-get update

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys  3B4FE6ACC0B21F32

最终成功安装openCV后程序依然报错:

解决方法:

①修改文件权限:sudo chmod 777 opencv4

②检查makeconfig文件中的路径是否正确

③修改makefile文件中`pkg-config --libs opencv`,添加opencv版本

编译过程中的警告

3.1

In file included from /home/u22045/opencv-4.5.4/modules/gapi/include/opencv2/gapi/util/optional.hpp:11,
                 from /home/u22045/opencv-4.5.4/modules/gapi/include/opencv2/gapi/gcommon.hpp:18,
                 from /home/u22045/opencv-4.5.4/modules/gapi/include/opencv2/gapi/gmat.hpp:15,
                 from /home/u22045/opencv-4.5.4/modules/gapi/include/opencv2/gapi/core.hpp:17,
                 from /home/u22045/opencv-4.5.4/modules/gapi/src/precomp.hpp:14,
                 from /home/u22045/opencv-4.5.4/modules/gapi/src/api/gproto.cpp:8:
In function ‘bool cv::util::operator==(const cv::util::variant<Types ...>&, const cv::util::variant<Types ...>&) [with Us = {cv::util::monostate, cv::GMatDesc, cv::GScalarDesc, cv::GArrayDesc, cv::GOpaqueDesc, cv::GFrameDesc}]’,
    inlined from ‘bool cv::can_describe(const GMetaArg&, const GRunArgP&)’ at /home/u22045/opencv-4.5.4/modules/gapi/src/api/gproto.cpp:166:68:
/home/u22045/opencv-4.5.4/modules/gapi/include/opencv2/gapi/util/variant.hpp:524:34: warning: ‘<anonymous>’ may be used uninitialized [-Wmaybe-uninitialized]
  524 |         return (eqs[lhs.index()])(lhs.memory, rhs.memory);
      |                ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/home/u22045/opencv-4.5.4/modules/gapi/include/opencv2/gapi/util/variant.hpp: In function ‘bool cv::can_describe(const GMetaArg&, const GRunArgP&)’:
/home/u22045/opencv-4.5.4/modules/gapi/include/opencv2/gapi/util/variant.hpp:132:25: note: by argument 2 of type ‘const std::aligned_storage<48, 8>::type*’ to ‘static bool cv::util::variant<Ts>::equal_h<T>::help(const typename std::aligned_storage<cv::util::variant<Ts>::S, cv::util::variant<Ts>::A>::type*, const typename std::aligned_storage<cv::util::variant<Ts>::S, cv::util::variant<Ts>::A>::type*) [with T = cv::GScalarDesc; Ts = {cv::util::monostate, cv::GMatDesc, cv::GScalarDesc, cv::GArrayDesc, cv::GOpaqueDesc, cv::GFrameDesc}]’ declared here
  132 |             static bool help(const Memory lhs, const Memory rhs) {
      |                         ^~~~
/home/u22045/opencv-4.5.4/modules/gapi/src/api/gproto.cpp:166:123: note: ‘<anonymous>’ declared here
  166 |     case GRunArgP::index_of<cv::Scalar*>():            return meta == GMetaArg(cv::descr_of(*util::get<cv::Scalar*>(argp)));
      |                                                                                                                           ^
In file included from /home/u22045/opencv-4.5.4/modules/gapi/include/opencv2/gapi/util/optional.hpp:11,
                 from /home/u22045/opencv-4.5.4/modules/gapi/include/opencv2/gapi/gcommon.hpp:18,
                 from /home/u22045/opencv-4.5.4/modules/gapi/include/opencv2/gapi/gmat.hpp:15,
                 from /home/u22045/opencv-4.5.4/modules/gapi/include/opencv2/gapi/core.hpp:17,
                 from /home/u22045/opencv-4.5.4/modules/gapi/src/precomp.hpp:14,
                 from /home/u22045/opencv-4.5.4/modules/gapi/src/api/gproto.cpp:8:
In function ‘bool cv::util::operator==(const cv::util::variant<Types ...>&, const cv::util::variant<Types ...>&) [with Us = {cv::util::monostate, cv::GMatDesc, cv::GScalarDesc, cv::GArrayDesc, cv::GOpaqueDesc, cv::GFrameDesc}]’,
    inlined from ‘bool cv::can_describe(const GMetaArg&, const GRunArgP&)’ at /home/u22045/opencv-4.5.4/modules/gapi/src/api/gproto.cpp:168:68:
/home/u22045/opencv-4.5.4/modules/gapi/include/opencv2/gapi/util/variant.hpp:524:34: warning: ‘<anonymous>’ may be used uninitialized [-Wmaybe-uninitialized]
  524 |         return (eqs[lhs.index()])(lhs.memory, rhs.memory);
      |                ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/home/u22045/opencv-4.5.4/modules/gapi/include/opencv2/gapi/util/variant.hpp: In function ‘bool cv::can_describe(const GMetaArg&, const GRunArgP&)’:
/home/u22045/opencv-4.5.4/modules/gapi/include/opencv2/gapi/util/variant.hpp:132:25: note: by argument 2 of type ‘const std::aligned_storage<48, 8>::type*’ to ‘static bool cv::util::variant<Ts>::equal_h<T>::help(const typename std::aligned_storage<cv::util::variant<Ts>::S, cv::util::variant<Ts>::A>::type*, const typename std::aligned_storage<cv::util::variant<Ts>::S, cv::util::variant<Ts>::A>::type*) [with T = cv::GArrayDesc; Ts = {cv::util::monostate, cv::GMatDesc, cv::GScalarDesc, cv::GArrayDesc, cv::GOpaqueDesc, cv::GFrameDesc}]’ declared here
  132 |             static bool help(const Memory lhs, const Memory rhs) {
      |                         ^~~~
/home/u22045/opencv-4.5.4/modules/gapi/src/api/gproto.cpp:168:129: note: ‘<anonymous>’ declared here
  168 |     case GRunArgP::index_of<cv::detail::VectorRef>():  return meta == GMetaArg(util::get<cv::detail::VectorRef>(argp).descr_of());
      |                                                                                                                                 ^
In file included from /home/u22045/opencv-4.5.4/modules/gapi/include/opencv2/gapi/util/optional.hpp:11,
                 from /home/u22045/opencv-4.5.4/modules/gapi/include/opencv2/gapi/gcommon.hpp:18,
                 from /home/u22045/opencv-4.5.4/modules/gapi/include/opencv2/gapi/gmat.hpp:15,
                 from /home/u22045/opencv-4.5.4/modules/gapi/include/opencv2/gapi/core.hpp:17,
                 from /home/u22045/opencv-4.5.4/modules/gapi/src/precomp.hpp:14,
                 from /home/u22045/opencv-4.5.4/modules/gapi/src/api/gproto.cpp:8:
In function ‘bool cv::util::operator==(const cv::util::variant<Types ...>&, const cv::util::variant<Types ...>&) [with Us = {cv::util::monostate, cv::GMatDesc, cv::GScalarDesc, cv::GArrayDesc, cv::GOpaqueDesc, cv::GFrameDesc}]’,
    inlined from ‘bool cv::can_describe(const GMetaArg&, const GRunArgP&)’ at /home/u22045/opencv-4.5.4/modules/gapi/src/api/gproto.cpp:169:68:
/home/u22045/opencv-4.5.4/modules/gapi/include/opencv2/gapi/util/variant.hpp:524:34: warning: ‘<anonymous>’ may be used uninitialized [-Wmaybe-uninitialized]
  524 |         return (eqs[lhs.index()])(lhs.memory, rhs.memory);
      |                ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/home/u22045/opencv-4.5.4/modules/gapi/include/opencv2/gapi/util/variant.hpp: In function ‘bool cv::can_describe(const GMetaArg&, const GRunArgP&)’:
/home/u22045/opencv-4.5.4/modules/gapi/include/opencv2/gapi/util/variant.hpp:132:25: note: by argument 2 of type ‘const std::aligned_storage<48, 8>::type*’ to ‘static bool cv::util::variant<Ts>::equal_h<T>::help(const typename std::aligned_storage<cv::util::variant<Ts>::S, cv::util::variant<Ts>::A>::type*, const typename std::aligned_storage<cv::util::variant<Ts>::S, cv::util::variant<Ts>::A>::type*) [with T = cv::GOpaqueDesc; Ts = {cv::util::monostate, cv::GMatDesc, cv::GScalarDesc, cv::GArrayDesc, cv::GOpaqueDesc, cv::GFrameDesc}]’ declared here
  132 |             static bool help(const Memory lhs, const Memory rhs) {
      |                         ^~~~
/home/u22045/opencv-4.5.4/modules/gapi/src/api/gproto.cpp:169:129: note: ‘<anonymous>’ declared here
  169 |     case GRunArgP::index_of<cv::detail::OpaqueRef>():  return meta == GMetaArg(util::get<cv::detail::OpaqueRef>(argp).descr_of());
      |                                                                                                                                 ^
In file included from /home/u22045/opencv-4.5.4/modules/gapi/include/opencv2/gapi/util/optional.hpp:11,
                 from /home/u22045/opencv-4.5.4/modules/gapi/include/opencv2/gapi/gcommon.hpp:18,
                 from /home/u22045/opencv-4.5.4/modules/gapi/include/opencv2/gapi/gmat.hpp:15,
                 from /home/u22045/opencv-4.5.4/modules/gapi/include/opencv2/gapi/core.hpp:17,
                 from /home/u22045/opencv-4.5.4/modules/gapi/src/precomp.hpp:14,
                 from /home/u22045/opencv-4.5.4/modules/gapi/src/api/gproto.cpp:8:
In function ‘bool cv::util::operator==(const cv::util::variant<Types ...>&, const cv::util::variant<Types ...>&) [with Us = {cv::util::monostate, cv::GMatDesc, cv::GScalarDesc, cv::GArrayDesc, cv::GOpaqueDesc, cv::GFrameDesc}]’,
    inlined from ‘bool cv::can_describe(const GMetaArg&, const cv::GRunArg&)’ at /home/u22045/opencv-4.5.4/modules/gapi/src/api/gproto.cpp:184:66:
/home/u22045/opencv-4.5.4/modules/gapi/include/opencv2/gapi/util/variant.hpp:524:34: warning: ‘<anonymous>’ may be used uninitialized [-Wmaybe-uninitialized]
  524 |         return (eqs[lhs.index()])(lhs.memory, rhs.memory);
      |                ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/home/u22045/opencv-4.5.4/modules/gapi/include/opencv2/gapi/util/variant.hpp: In function ‘bool cv::can_describe(const GMetaArg&, const cv::GRunArg&)’:
/home/u22045/opencv-4.5.4/modules/gapi/include/opencv2/gapi/util/variant.hpp:132:25: note: by argument 2 of type ‘const std::aligned_storage<48, 8>::type*’ to ‘static bool cv::util::variant<Ts>::equal_h<T>::help(const typename std::aligned_storage<cv::util::variant<Ts>::S, cv::util::variant<Ts>::A>::type*, const typename std::aligned_storage<cv::util::variant<Ts>::S, cv::util::variant<Ts>::A>::type*) [with T = cv::GScalarDesc; Ts = {cv::util::monostate, cv::GMatDesc, cv::GScalarDesc, cv::GArrayDesc, cv::GOpaqueDesc, cv::GFrameDesc}]’ declared here
  132 |             static bool help(const Memory lhs, const Memory rhs) {
      |                         ^~~~
/home/u22045/opencv-4.5.4/modules/gapi/src/api/gproto.cpp:184:118: note: ‘<anonymous>’ declared here
  184 |     case GRunArg::index_of<cv::Scalar>():            return meta == cv::GMetaArg(descr_of(util::get<cv::Scalar>(arg)));
      |                                                                                                                      ^
In file included from /home/u22045/opencv-4.5.4/modules/gapi/include/opencv2/gapi/util/optional.hpp:11,
                 from /home/u22045/opencv-4.5.4/modules/gapi/include/opencv2/gapi/gcommon.hpp:18,
                 from /home/u22045/opencv-4.5.4/modules/gapi/include/opencv2/gapi/gmat.hpp:15,
                 from /home/u22045/opencv-4.5.4/modules/gapi/include/opencv2/gapi/core.hpp:17,
                 from /home/u22045/opencv-4.5.4/modules/gapi/src/precomp.hpp:14,
                 from /home/u22045/opencv-4.5.4/modules/gapi/src/api/gproto.cpp:8:
In function ‘bool cv::util::operator==(const cv::util::variant<Types ...>&, const cv::util::variant<Types ...>&) [with Us = {cv::util::monostate, cv::GMatDesc, cv::GScalarDesc, cv::GArrayDesc, cv::GOpaqueDesc, cv::GFrameDesc}]’,
    inlined from ‘bool cv::can_describe(const GMetaArg&, const cv::GRunArg&)’ at /home/u22045/opencv-4.5.4/modules/gapi/src/api/gproto.cpp:185:66:
/home/u22045/opencv-4.5.4/modules/gapi/include/opencv2/gapi/util/variant.hpp:524:34: warning: ‘<anonymous>’ may be used uninitialized [-Wmaybe-uninitialized]
  524 |         return (eqs[lhs.index()])(lhs.memory, rhs.memory);
      |                ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/home/u22045/opencv-4.5.4/modules/gapi/include/opencv2/gapi/util/variant.hpp: In function ‘bool cv::can_describe(const GMetaArg&, const cv::GRunArg&)’:
/home/u22045/opencv-4.5.4/modules/gapi/include/opencv2/gapi/util/variant.hpp:132:25: note: by argument 2 of type ‘const std::aligned_storage<48, 8>::type*’ to ‘static bool cv::util::variant<Ts>::equal_h<T>::help(const typename std::aligned_storage<cv::util::variant<Ts>::S, cv::util::variant<Ts>::A>::type*, const typename std::aligned_storage<cv::util::variant<Ts>::S, cv::util::variant<Ts>::A>::type*) [with T = cv::GArrayDesc; Ts = {cv::util::monostate, cv::GMatDesc, cv::GScalarDesc, cv::GArrayDesc, cv::GOpaqueDesc, cv::GFrameDesc}]’ declared here
  132 |             static bool help(const Memory lhs, const Memory rhs) {
      |                         ^~~~
/home/u22045/opencv-4.5.4/modules/gapi/src/api/gproto.cpp:185:130: note: ‘<anonymous>’ declared here
  185 |     case GRunArg::index_of<cv::detail::VectorRef>(): return meta == cv::GMetaArg(util::get<cv::detail::VectorRef>(arg).descr_of());
      |                                                                                                                                  ^
In file included from /home/u22045/opencv-4.5.4/modules/gapi/include/opencv2/gapi/util/optional.hpp:11,
                 from /home/u22045/opencv-4.5.4/modules/gapi/include/opencv2/gapi/gcommon.hpp:18,
                 from /home/u22045/opencv-4.5.4/modules/gapi/include/opencv2/gapi/gmat.hpp:15,
                 from /home/u22045/opencv-4.5.4/modules/gapi/include/opencv2/gapi/core.hpp:17,
                 from /home/u22045/opencv-4.5.4/modules/gapi/src/precomp.hpp:14,
                 from /home/u22045/opencv-4.5.4/modules/gapi/src/api/gproto.cpp:8:
In function ‘bool cv::util::operator==(const cv::util::variant<Types ...>&, const cv::util::variant<Types ...>&) [with Us = {cv::util::monostate, cv::GMatDesc, cv::GScalarDesc, cv::GArrayDesc, cv::GOpaqueDesc, cv::GFrameDesc}]’,
    inlined from ‘bool cv::can_describe(const GMetaArg&, const cv::GRunArg&)’ at /home/u22045/opencv-4.5.4/modules/gapi/src/api/gproto.cpp:186:66:
/home/u22045/opencv-4.5.4/modules/gapi/include/opencv2/gapi/util/variant.hpp:524:34: warning: ‘<anonymous>’ may be used uninitialized [-Wmaybe-uninitialized]
  524 |         return (eqs[lhs.index()])(lhs.memory, rhs.memory);
      |                ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/home/u22045/opencv-4.5.4/modules/gapi/include/opencv2/gapi/util/variant.hpp: In function ‘bool cv::can_describe(const GMetaArg&, const cv::GRunArg&)’:
/home/u22045/opencv-4.5.4/modules/gapi/include/opencv2/gapi/util/variant.hpp:132:25: note: by argument 2 of type ‘const std::aligned_storage<48, 8>::type*’ to ‘static bool cv::util::variant<Ts>::equal_h<T>::help(const typename std::aligned_storage<cv::util::variant<Ts>::S, cv::util::variant<Ts>::A>::type*, const typename std::aligned_storage<cv::util::variant<Ts>::S, cv::util::variant<Ts>::A>::type*) [with T = cv::GOpaqueDesc; Ts = {cv::util::monostate, cv::GMatDesc, cv::GScalarDesc, cv::GArrayDesc, cv::GOpaqueDesc, cv::GFrameDesc}]’ declared here
  132 |             static bool help(const Memory lhs, const Memory rhs) {
      |                         ^~~~
/home/u22045/opencv-4.5.4/modules/gapi/src/api/gproto.cpp:186:130: note: ‘<anonymous>’ declared here
  186 |     case GRunArg::index_of<cv::detail::OpaqueRef>(): return meta == cv::GMetaArg(util::get<cv::detail::OpaqueRef>(arg).descr_of());
      |    

3.2

/home/u22045/opencv-4.5.4/modules/core/test/test_mat.cpp: In member function ‘void cv::Mat::forEach_impl(const Functor&)::PixelOperationWrapper::operator()(const cv::Range&) const [with _Tp = cv::Point3_<int>; Functor = opencv_test::{anonymous}::InitializerFunctor<cv::Point3_<int> >]’:
/home/u22045/opencv-4.5.4/modules/core/test/test_mat.cpp:595:24: warning: array subscript 2 is outside array bounds of ‘cv::Mat::forEach_impl<cv::Point3_<int>, opencv_test::{anonymous}::InitializerFunctor<cv::Point3_<int> > >(const opencv_test::{anonymous}::InitializerFunctor<cv::Point3_<int> >&)::PixelOperationWrapper::rowCall2(int, int) const::Index [1]’ [-Warray-bounds]
  595 |         pixel.z = idx[2];
      |                   ~~~~~^
In file included from /home/u22045/opencv-4.5.4/modules/core/include/opencv2/core.hpp:3307,
                 from /home/u22045/opencv-4.5.4/modules/ts/include/opencv2/ts.hpp:10,
                 from /home/u22045/opencv-4.5.4/modules/core/test/test_precomp.hpp:7,
                 from /home/u22045/opencv-4.5.4/modules/core/test/test_mat.cpp:4:
/home/u22045/opencv-4.5.4/modules/core/include/opencv2/core/utility.hpp:692:15: note: while referencing ‘idx’
  692 |             } idx = {{row, 0}};
      |               ^~~
/home/u22045/opencv-4.5.4/modules/core/test/test_mat.cpp: In member function ‘void cv::Mat::forEach_impl(const Functor&)::PixelOperationWrapper::operator()(const cv::Range&) const [with _Tp = cv::Vec<int, 5>; Functor = opencv_test::{anonymous}::InitializerFunctor5D<cv::Vec<int, 5> >]’:
/home/u22045/opencv-4.5.4/modules/core/test/test_mat.cpp:605:25: warning: array subscript 2 is outside array bounds of ‘cv::Mat::forEach_impl<cv::Vec<int, 5>, opencv_test::{anonymous}::InitializerFunctor5D<cv::Vec<int, 5> > >(const opencv_test::{anonymous}::InitializerFunctor5D<cv::Vec<int, 5> >&)::PixelOperationWrapper::rowCall2(int, int) const::Index [1]’ [-Warray-bounds]
  605 |         pixel[2] = idx[2];
      |                    ~~~~~^
In file included from /home/u22045/opencv-4.5.4/modules/core/include/opencv2/core.hpp:3307,
                 from /home/u22045/opencv-4.5.4/modules/ts/include/opencv2/ts.hpp:10,
                 from /home/u22045/opencv-4.5.4/modules/core/test/test_precomp.hpp:7,
                 from /home/u22045/opencv-4.5.4/modules/core/test/test_mat.cpp:4:
/home/u22045/opencv-4.5.4/modules/core/include/opencv2/core/utility.hpp:692:15: note: while referencing ‘idx’
  692 |             } idx = {{row, 0}};
      |               ^~~
/home/u22045/opencv-4.5.4/modules/core/test/test_mat.cpp:606:25: warning: array subscript 3 is outside array bounds of ‘cv::Mat::forEach_impl<cv::Vec<int, 5>, opencv_test::{anonymous}::InitializerFunctor5D<cv::Vec<int, 5> > >(const opencv_test::{anonymous}::InitializerFunctor5D<cv::Vec<int, 5> >&)::PixelOperationWrapper::rowCall2(int, int) const::Index [1]’ [-Warray-bounds]
  606 |         pixel[3] = idx[3];
      |                    ~~~~~^
In file included from /home/u22045/opencv-4.5.4/modules/core/include/opencv2/core.hpp:3307,
                 from /home/u22045/opencv-4.5.4/modules/ts/include/opencv2/ts.hpp:10,
                 from /home/u22045/opencv-4.5.4/modules/core/test/test_precomp.hpp:7,
                 from /home/u22045/opencv-4.5.4/modules/core/test/test_mat.cpp:4:
/home/u22045/opencv-4.5.4/modules/core/include/opencv2/core/utility.hpp:692:15: note: while referencing ‘idx’
  692 |             } idx = {{row, 0}};
      |               ^~~
/home/u22045/opencv-4.5.4/modules/core/test/test_mat.cpp:607:25: warning: array subscript 4 is outside array bounds of ‘cv::Mat::forEach_impl<cv::Vec<int, 5>, opencv_test::{anonymous}::InitializerFunctor5D<cv::Vec<int, 5> > >(const opencv_test::{anonymous}::InitializerFunctor5D<cv::Vec<int, 5> >&)::PixelOperationWrapper::rowCall2(int, int) const::Index [1]’ [-Warray-bounds]
  607 |         pixel[4] = idx[4];
      |                    ~~~~~^
In file included from /home/u22045/opencv-4.5.4/modules/core/include/opencv2/core.hpp:3307,
                 from /home/u22045/opencv-4.5.4/modules/ts/include/opencv2/ts.hpp:10,
                 from /home/u22045/opencv-4.5.4/modules/core/test/test_precomp.hpp:7,
                 from /home/u22045/opencv-4.5.4/modules/core/test/test_mat.cpp:4:
/home/u22045/opencv-4.5.4/modules/core/include/opencv2/core/utility.hpp:692:15: note: while referencing ‘idx’
  692 |             } idx = {{row, 0}};
      |               ^~~


 

后续若安装ROS可参考该链接:windows 11安装wsl2,ROS以及窗口可视化 | 公孙启https://www.gongsunqi.xyz/posts/451c48f3/

WSL2中环境配置可参考改链接:Win11基于WSL2安装CUDA、cuDNN和TensorRT(2023-03-01)_cudnn wsl install-CSDN博客https://blog.csdn.net/Apple_Coco/article/details/129293019#:~:text=%E6%9C%AC%E6%96%87%E8%AF%A6%E7%BB%86%E8%AE%B0%E5%BD%95%E4%BA%86%E5%9C%A8WSL2%E7%8E%AF%E5%A2%83%E4%B8%8B%E5%AE%89%E8%A3%85TensorRT%E3%80%81CUDA%E5%92%8CcuDNN%E7%9A%84%E6%AD%A5%E9%AA%A4%EF%BC%8C%E5%8C%85%E6%8B%AC%E7%8E%AF%E5%A2%83%E9%85%8D%E7%BD%AE%E3%80%81%E9%A9%B1%E5%8A%A8%E6%A3%80%E6%9F%A5%E3%80%81%E5%AE%89%E8%A3%85%E8%BF%87%E7%A8%8B%E5%8F%8A%E5%8F%AF%E8%83%BD%E5%87%BA%E7%8E%B0%E7%9A%84%E9%97%AE%E9%A2%98%E5%92%8C%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88%EF%BC%8C%E7%89%B9%E5%88%AB%E6%98%AF%E5%85%B3%E4%BA%8Envcc%E7%89%88%E6%9C%AC%E5%92%8C%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E9%85%8D%E7%BD%AE%E7%9A%84%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9%E3%80%82%20%E6%91%98%E8%A6%81%E7%94%9F%E6%88%90%E4%BA%8E%20C%E7%9F%A5%E9%81%93%20%EF%BC%8C%E7%94%B1,DeepSeek-R1%20%E6%BB%A1%E8%A1%80%E7%89%88%E6%94%AF%E6%8C%81%EF%BC%8C%20%E5%89%8D%E5%BE%80%E4%BD%93%E9%AA%8C%20%3E

Windows11 + WSL Ubuntu + Pycharm + Conda for deeplearning | 公孙启https://www.gongsunqi.xyz/posts/3c995b2a/

Logo

欢迎来到FlagOS开发社区,这里是一个汇聚了AI开发者、数据科学家、机器学习爱好者以及业界专家的活力平台。我们致力于成为业内领先的Triton技术交流与应用分享的殿堂,为推动人工智能技术的普及与深化应用贡献力量。

更多推荐