VIM3 yolov3 convert issue

I downloaded the newly released sdk last week and am working on the document below.

cfg file was downloaded from the path below.

The weight file was downloaded from the path below.
https://pjreddie.com/media/files/yolov3.weights

I succeeded in creating a yolov3.so file and a .nb file according to the document.
Based on this, when I ran the demo source, the results came out strange.

Can you possibly tell what is the cause?

image

@kwonSangKyun Hello, this is fixup with SDK 6.4.3. The new SDK will be available for download within today.

@kwonSangKyun The New SDK can be download now .

2 Likes

Tanks for your answer

@Frank Frank, i was trying to implement yolov3 on VIM3. But during the process, I get the following error.
Pls note that I have already downloaded the weights and .cfg file. Now even when I give the path as arguments, I am getting this error. Please help me with the same.

@Akkisony Darknet don’t need net-input and net-output parameters

@Frank I trained a custom object detection - Yolov3 using darknet. The traing was done in python and I generated yolov3.weights and yolov3.cfg file.

I used the demo to convert them to run on the NPU. I did not get any error during the process and all worked fine.

But when I execute the command ./detect_demo_x11 2 image.jpg I am getting segmentation fault.

Opencv version is 4.2.0
SDK version 6.4.3

Kindly help me solve this issue. @numbqq @Frank Thank you in advance!

@Akkisony Did you change the class num ? If you change it , you need to modifiy the source code for libnn_yolov3.so

@Frank Yes, I changed the number of classes to 1.
And I have a doubt with coco_names aswell. Since I am working with one class, do I have to change those into just my class name? My class name is “holes”. Do I have to modify the class name?

Can you please elaborate on how I need to modify these as I am not able to open that file.

@Akkisony

@Frank I did everything from the following document - How to convert and call your own model through NPU | Khadas Documentation

But I had read a previous comment from you in this forum.

I followed your instruction and did “sudo apt remove opencv3”. Now when, I execute ./detect_demo_x11 2 image.jpg I am getting an error shown below.

I checked that OpenCV 4.2.0 is installed

@Akkisony If you want to use opencv4.2, you need to rebuild the source code with opencv4.2.

@Frank @numbqq okay, I’ll try that only if the traditional method doesn’t work. The source code is written in which OpenCV version? Is it 3.4? I am not sure about modifying the source code, so please tell me which version needs to be installed to fix this error.
Thank you!

@Frank @numbqq Please let me know what and which version needs to be installed in order to overcome the mentioned error.
"./detect_demo_x11: error while loading shared libraries: libopencv_imgproc.so.3.4: cannot open shared object file: No such file or directory"

If OpenCV 3 needs to be installed, I tried doing that, but I am getting an error.

khadas@Khadas:~/aml_npu_demo_binaries/detect_demo_picture$ sudo apt install opencv3
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following NEW packages will be installed:
** opencv3**
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 8,123 kB of archives.
After this operation, 1,024 B of additional disk space will be used.
Get:1 https://dl.khadas.com/repos/vim3 focal/main arm64 opencv3 arm64 3.4.3-2 [8,123 kB]
Fetched 8,123 kB in 1s (15.1 MB/s)
Selecting previously unselected package opencv3.
(Reading database … 83691 files and directories currently installed.)
Preparing to unpack …/opencv3_3.4.3-2_arm64.deb …
Unpacking opencv3 (3.4.3-2) …
dpkg: error processing archive /var/cache/apt/archives/opencv3_3.4.3-2_arm64.deb (–unpack):
** trying to overwrite ‘/usr/bin/opencv_annotation’, which is also in package libopencv-dev 4.2.0+dfsg-5**
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
** /var/cache/apt/archives/opencv3_3.4.3-2_arm64.deb**
E: Sub-process /usr/bin/dpkg returned an error code (1)

Please let me know a possible solution!

You need to uninstall opencv4 if you want to install opencv3.

@numbqq Will Uninstalling OpenCV 4 and installing Opencv3 solve my below mentioned issue?

As said above, the demo is prebuild based on opencv3, If you want to run such demos, you need opencv3 installed.

The errer means no opencv3 libraries, so you need to uninstall opencv4 and install opencv3.

@numbqq @Frank Thank you very much! :slight_smile: I installed OpenCV 3 and overcame that error. But Now, I am getting this error as can be seen in the screenshot. Please let me know what went wrong.
Please note that I did not recieve any error during the process of executing the shell script using bash command.

@Frank @numbqq I modified the 3 parameters in yolov3_process.c
Since my number of classes = 1.

I replaced the following:-

*coco_names[] = [“holes”]
num_classes = 1
int size[3]={nn_width/32, nn_height/32, 6 * 3}

After replacing these and when I try builidng it, I am getting the below mentioned error.

Though this generates the bin_r directory, only 3 files are created. “libnn_yolo_v3.so” is missing in “bin_r”.

@Akkisony

khadas@Khadas:~$ sudo find / -name "*CLC*"
find: ‘/sys/kernel/slab’: Input/output error
/usr/lib/libCLC.so

Did you modfiied the Makefile file ? Did you use the least release OTA version ?