您好,尝试使用 RkLunch-stop.sh 来关闭 rkipc 进程,它会确保 rkipc 进程被彻底关闭并给出提醒。kw_ddw wrote: ↑2024-04-18 14:55 您好,我在rv1103上运行使用opencv-mobile库的代码时,遇到摄像头图像无法读取的情况。之后我运行了opencv-mobile例程,遇到同样的问题.
具体输出如下。此后程序卡死,无任何输出。Code: Select all
# pwd / # killall rkipc killall: rkipc: no process killed # ./opencv-mobile-test opencv-mobile HW JPG encoder with rk mpp opencv-mobile MIPI CSI camera with v4l2 rkaiq devpath = /dev/video11 driver = rkisp_v7 card = rkisp_mainpath bus_info = platform:rkisp-vir0 version = 20000 capabilities = 84201000 device_caps = 4201000 fmt = UYVY 4:2:2 59565955 fmt = Y/CbCr 4:2:2 3631564e fmt = Y/CrCb 4:2:2 3136564e fmt = Y/CrCb 4:2:0 3132564e size = 32 x 16 ~ 2304 x 1296 (+8 +8) fmt = Y/CbCr 4:2:0 3231564e fmt = Y/CrCb 4:2:0 (N-C) 31324d4e fmt = Y/CbCr 4:2:0 (N-C) 32314d4e rkaiq log level ff0
无法运行restart_rknn.sh
您好,我使用RkLunch-stop.sh成功重启了摄像头。但是我又遇到了新的问题:内存不足
我的代码先是用opencv打开了摄像头,然后初始化rknn模型推理,在初始化模型推理这一步遇到了内存不足的问题。我现在想要更换开发板上的内存,请问我可以直接焊接容量更大的内存吗(比如附件中所示内存)
Code: Select all
# ./rknn_yolov5_demo model/yolov5.rknn
opencv-mobile MIPI CSI camera with v4l2 rkaiq
devpath = /dev/video11
driver = rkisp_v7
card = rkisp_mainpath
bus_info = platform:rkisp-vir0
version = 20000
capabilities = 84201000
device_caps = 4201000
fmt = UYVY 4:2:2 59565955
fmt = Y/CbCr 4:2:2 3631564e
fmt = Y/CrCb 4:2:2 3136564e
fmt = Y/CrCb 4:2:0 3132564e
size = 32 x 16 ~ 2304 x 1296 (+8 +8)
fmt = Y/CbCr 4:2:0 3231564e
fmt = Y/CrCb 4:2:0 (N-C) 31324d4e
fmt = Y/CbCr 4:2:0 (N-C) 32314d4e
rkaiq log level ff0
/dev/video11 does not support changing fps
rga_api version 1.10.1_[0]
w = 320 , h = 240load lable ./model/coco_80_labels_list.txt
model input num: 1, output num: 3
input tensors:
index=0, name=images, n_dims=4, dims=[1, 640, 640, 3], n_elems=1228800, size=1228800, fmt=NHWC, type=INT8, qnt_type=AFFINE, zp=-128, scale=0.003922
output tensors:
index=0, name=output0, n_dims=4, dims=[1, 80, 80, 255], n_elems=1632000, size=1632000, fmt=NHWC, type=INT8, qnt_type=AFFINE, zp=-128, scale=0.003922
index=1, name=367, n_dims=4, dims=[1, 40, 40, 255], n_elems=408000, size=408000, fmt=NHWC, type=INT8, qnt_type=AFFINE, zp=-128, scale=0.003922
index=2, name=369, n_dims=4, dims=[1, 20, 20, 255], n_elems=102000, size=102000, fmt=NHWC, type=INT8, qnt_type=AFFINE, zp=-128, scale=0.003922
input_attrs[0].size_with_stride=1228800
E RKNN: failed to allocate fd, ret: -1, errno: 12, errstr: Cannot allocate memory
output_mems rknn_set_io_mem fail! ret=-5
init_yolov5_model fail! ret=-1 model_path=model/yolov5.rknn
MessageParser process loop exit!
另外我的程序中执行打印输入图像的w*h
之后继续打印程序卡死,中间没有任何其他的操作。
之后继续打印程序卡死,中间没有任何其他的操作。
Code: Select all
const char *model_path = argv[1];
cv::VideoCapture cap;
cap.set(cv::CAP_PROP_FRAME_WIDTH, 320);
cap.set(cv::CAP_PROP_FRAME_HEIGHT, 240);
cap.open(0);
const int w = cap.get(cv::CAP_PROP_FRAME_WIDTH);
const int h = cap.get(cv::CAP_PROP_FRAME_HEIGHT);
printf("w = %d , h = %d\n",w,h);可以打印出来
printf("8");打印不出来
int ret;
您好,Luckfox-pico 使用的内存是片内的DDR,没有将内存的相关接口引出,没有相应的地方可以焊接内存芯片,很遗憾无法实现您的想法,如果需要更高规模的内存只能选择换RV1106系列的Luckfox-pico, 还有一个解决方案就是调整 <Luckfox-pico SDK>/project/cfg 中对应的.mk文件,调整 RK_BOOTARGS_CMA_SIZE 选项。这个 RK_BOOTARGS_CMA_SIZE 是RK多媒体库使用的,与计算机直接申请的 CMA 是不一样的,它和内存是共有的,如果选择降低它就需要降低分辨率让多媒体库可以运行。kw_ddw wrote: ↑2024-04-19 12:58 您好,我使用RkLunch-stop.sh成功重启了摄像头。但是我又遇到了新的问题:内存不足我的代码先是用opencv打开了摄像头,然后初始化rknn模型推理,在初始化模型推理这一步遇到了内存不足的问题。我现在想要更换开发板上的内存,请问我可以直接焊接容量更大的内存吗(比如附件中所示内存)Code: Select all
# ./rknn_yolov5_demo model/yolov5.rknn opencv-mobile MIPI CSI camera with v4l2 rkaiq devpath = /dev/video11 driver = rkisp_v7 card = rkisp_mainpath bus_info = platform:rkisp-vir0 version = 20000 capabilities = 84201000 device_caps = 4201000 fmt = UYVY 4:2:2 59565955 fmt = Y/CbCr 4:2:2 3631564e fmt = Y/CrCb 4:2:2 3136564e fmt = Y/CrCb 4:2:0 3132564e size = 32 x 16 ~ 2304 x 1296 (+8 +8) fmt = Y/CbCr 4:2:0 3231564e fmt = Y/CrCb 4:2:0 (N-C) 31324d4e fmt = Y/CbCr 4:2:0 (N-C) 32314d4e rkaiq log level ff0 /dev/video11 does not support changing fps rga_api version 1.10.1_[0] w = 320 , h = 240load lable ./model/coco_80_labels_list.txt model input num: 1, output num: 3 input tensors: index=0, name=images, n_dims=4, dims=[1, 640, 640, 3], n_elems=1228800, size=1228800, fmt=NHWC, type=INT8, qnt_type=AFFINE, zp=-128, scale=0.003922 output tensors: index=0, name=output0, n_dims=4, dims=[1, 80, 80, 255], n_elems=1632000, size=1632000, fmt=NHWC, type=INT8, qnt_type=AFFINE, zp=-128, scale=0.003922 index=1, name=367, n_dims=4, dims=[1, 40, 40, 255], n_elems=408000, size=408000, fmt=NHWC, type=INT8, qnt_type=AFFINE, zp=-128, scale=0.003922 index=2, name=369, n_dims=4, dims=[1, 20, 20, 255], n_elems=102000, size=102000, fmt=NHWC, type=INT8, qnt_type=AFFINE, zp=-128, scale=0.003922 input_attrs[0].size_with_stride=1228800 E RKNN: failed to allocate fd, ret: -1, errno: 12, errstr: Cannot allocate memory output_mems rknn_set_io_mem fail! ret=-5 init_yolov5_model fail! ret=-1 model_path=model/yolov5.rknn MessageParser process loop exit!
同时注意到您使用 RV1103 运行 Yolov5 模型,我们之前经过测试受内存限制是无法运行的,但是更小规模功能相似的 Nanodet 模型是可以的,但是考虑到Nanodet的部署相较 Yolov5 较为复杂且需求较低,我们仅测试了其内存占用情况,并没有做完整的移植。
对于这种情况之前我也遇到过,我猜测可能是因为Opencv-mobile 或其使用 RKAIQ(ISP相关)会在调用到 cv::VideoCapture 的程序启动阶段就运行,验证相关的设备信息,开始分配内存,而另一个线程运行其他部分。当媒体库这边内存分配过程中发生异常就会导致主线程这边发生错误。我觉得大概率也是内存的问题,后续我获得准确答案后会及时通知您。kw_ddw wrote: ↑2024-04-19 13:28 另外我的程序中执行打印输入图像的w*h
之后继续打印程序卡死,中间没有任何其他的操作。
Code: Select all
const char *model_path = argv[1]; cv::VideoCapture cap; cap.set(cv::CAP_PROP_FRAME_WIDTH, 320); cap.set(cv::CAP_PROP_FRAME_HEIGHT, 240); cap.open(0); const int w = cap.get(cv::CAP_PROP_FRAME_WIDTH); const int h = cap.get(cv::CAP_PROP_FRAME_HEIGHT); printf("w = %d , h = %d\n",w,h);可以打印出来 printf("8");打印不出来 int ret;