VIM3 yolov3 convert issue

@Frank I got the following output as seen below.

khadas@Khadas:~$ sudo find / -name "CLC"
[sudo] password for khadas:
find: ‘/sys/kernel/slab’: Input/output error

I did not make any changes to Makefile. Last week when I worked on this, I could generate the .so file, it’s unfortunate that now I am unable to generate that file.

@Akkisony Did you upgrade to the least release OTA version ?

@Frank
khadas@Khadas:~$ sudo apt update
[sudo] password for khadas:
Hit:1 http://ports.ubuntu.com focal InRelease
Hit:2 https://dl.khadas.com/repos/vim3 focal InRelease
Get:3 http://ports.ubuntu.com focal-security InRelease [114 kB]
Get:4 http://ports.ubuntu.com focal-updates InRelease [114 kB]
Get:5 http://ports.ubuntu.com focal-backports InRelease [101 kB]
Get:6 http://ports.ubuntu.com focal-security/main arm64 Packages [601 kB]
Get:7 http://ports.ubuntu.com focal-security/main armhf Packages [538 kB]
Get:8 http://ports.ubuntu.com focal-security/universe arm64 Packages [669 kB]
Get:9 http://ports.ubuntu.com focal-security/universe armhf Packages [538 kB]
Get:10 http://ports.ubuntu.com focal-updates/main armhf Packages [930 kB]
Get:11 http://ports.ubuntu.com focal-updates/universe arm64 Packages [923 kB]
Get:12 http://ports.ubuntu.com focal-updates/main arm64 Packages [997 kB]
Get:13 http://ports.ubuntu.com focal-updates/universe armhf Packages [788 kB]
Fetched 6,312 kB in 3s (2,127 kB/s)
Reading package lists… Done
Building dependency tree
Reading state information… Done
All packages are up to date.

@Akkisony You can try with this firmware

http://dl.khadas.com/Firmware/VIM3/Ubuntu/EMMC/VIM3_Ubuntu-server-focal_Linux-4.9_arm64_EMMC_V1.0.6-210520.img.xz

@Frank I am not able to download this. Can you please reshare the link?

@Frank Please also tell me why is it necessary to flash a new image to VIM3?

Which image you used now ? The old image is not compatible with latest npu sdk.

Please provide the follow command outpts:

$ uname -a
$ cat /etc/fenix-release 
1 Like

@numbqq Thank you for replying.

khadas@Khadas:~$ uname -a
Linux Khadas 4.9.241 #13 SMP PREEMPT Thu May 20 10:40:43 CST 2021 aarch64 aarch64 aarch64 GNU/Linux
khadas@Khadas:~$ cat /etc/fenix-release
# PLEASE DO NOT EDIT THIS FILE
BOARD=VIM3
VENDOR=Amlogic
VERSION=1.0.6
ARCH=arm64
INITRD_ARCH=arm64
INSTALL_TYPE=EMMC
IMAGE_VERSION=V1.0.6-210520
################ GIT VERSION ################
UBOOT_GIT_VERSION=khadas-vims-v1.0.6-release
LINUX_GIT_VERSION=khadas-vims-v1.0.6-release
FENIX_GIT_VERSION=v1.0.6
#############################################

Please find the output!

I am using SDK Version 6.4.3 @Frank

Your system is already the latest one. Can you try our prebuild demos to check whether it works?

@numbqq I tried the inception demo and it works fine with me. But here I am not generating any .so or .nb file. I am using the current existing file in the demo.

In the demo when I tried working with detect_demo_picture, I got the following output:

Picture : khadas@Khadas:~/test/aml_npu_demo_binaries/detect_demo_picture$ sudo ./INSTALL
khadas@Khadas:~/test/aml_npu_demo_binaries/detect_demo_picture$ ./detect_demo_x11 2 1080p.bmp
W Detect_api:[det_set_log_level:19]Set log level=1
W Detect_api:[det_set_log_level:21]output_format not support Imperfect, default to DET_LOG_TERMINAL
W Detect_api:[det_set_log_level:26]Not exist VSI_NN_LOG_LEVEL, Setenv set_vsi_log_error_level
det_set_log_config Debug
det_set_model success!!

model.width:416
model.height:416
model.channel:3

But, my question is last week when I tried to build my own custom model, i could generate the .so file.
I have not made any changes to the Make file or anything. Now, I am not able to generate .so file in bin_r directory.

Please see the output below:

khadas@Khadas:~/aml_npu_app/DDK_6.4.3/detect_library/model_code/detect_yolo_v3$ ./build_vx.sh
  COMPILE /home/khadas/aml_npu_app/DDK_6.3.3.4/detect_library/model_code/detect_yolo_v3/yolov3_process.c
  COMPILE /home/khadas/aml_npu_app/DDK_6.3.3.4/detect_library/model_code/detect_yolo_v3/vnn_yolov3.c
vnn_yolov3.c: In function ‘vnn_CreateYolov3’:
vnn_yolov3.c:145:29: warning: unused variable ‘data’ [-Wunused-variable]
  145 |     uint8_t *               data;
      |                             ^~~~
At top level:
vnn_yolov3.c:94:17: warning: ‘load_data’ defined but not used [-Wunused-function]
   94 | static uint8_t* load_data
      |                 ^~~~~~~~~
  COMPILE /home/khadas/aml_npu_app/DDK_6.3.3.4/detect_library/model_code/detect_yolo_v3/yolo_v3.c
/usr/bin/ld: cannot find -lCLC
collect2: error: ld returned 1 exit status
make: *** [makefile.linux:47: bin_r/libnn_yolo_v3.so] Error 1

Please help me with the same! @Frank

For the prebuild demo, please use the -h option to get the usage.

khadas@Khadas:~/detect_demo_picture$ ./detect_demo_fb -h
./detect_demo_fb: option requires an argument -- 'h'
./detect_demo_fb [-p picture path] [-w width] [-h height] [-m model type] [-f facenet flag] [-H]

For eaxmple, picture detect demo and display on fb:

$ ./detect_demo_fb -p 1080p.bmp -m 2

The usage changed. We will update the docs.

@Akkisony You must have some changes to the system, so suggest to reflash the latest image here: http://dl.khadas.com/Firmware/VIM3/Ubuntu/EMMC/VIM3_Ubuntu-server-focal_Linux-4.9_arm64_EMMC_V1.0.6-210520.img.xz

I have checked this image, I can build without problems.

khadas@Khadas:~/aml_npu_app/DDK_6.4.4.3/detect_library/model_code/detect_yolo_v3$ ./build_vx.sh 
  COMPILE /home/khadas/aml_npu_app/DDK_6.3.3.4/detect_library/model_code/detect_yolo_v3/yolov3_process.c
  COMPILE /home/khadas/aml_npu_app/DDK_6.3.3.4/detect_library/model_code/detect_yolo_v3/vnn_yolov3.c
vnn_yolov3.c: In function ‘vnn_CreateYolov3’:
vnn_yolov3.c:145:29: warning: unused variable ‘data’ [-Wunused-variable]
  145 |     uint8_t *               data;
      |                             ^~~~
At top level:
vnn_yolov3.c:94:17: warning: ‘load_data’ defined but not used [-Wunused-function]
   94 | static uint8_t* load_data
      |                 ^~~~~~~~~
  COMPILE /home/khadas/aml_npu_app/DDK_6.3.3.4/detect_library/model_code/detect_yolo_v3/yolo_v3.c
make: Nothing to be done for 'all'.
khadas@Khadas:~/aml_npu_app/DDK_6.4.4.3/detect_library/model_code/detect_yolo_v3$ ls bin_r/*.so
bin_r/libnn_yolo_v3.so
khadas@Khadas:~/aml_npu_app/DDK_6.4.4.3/detect_library/model_code/detect_yolo_v3$ 

@numbqq Please let me know when will the new document be uploaded. Also it would be great it you can give a detailed explanation on how to run MobileNet model on VIM3; just like yolov3 tutorial.

One topic for one thing. In this topic we only talk about the yolo model issue.

I have provided the correct usage for yolo picture detect above, please check whether it works for you.

$ ./detect_demo_fb -p 1080p.bmp -m 2
or
$ ./detect_demo_x11 -p 1080p.bmp -m 2

For other model, you need to convert them youself, you can follow the instructions docs from the SDK.

Hello, when using this version under Windows and using USB_Burning_Tool_V2.x.x.exe for USB firmware upgrade, do I need to unzip the file first?

@numbqq Thank you fro your help.
@Frank
I am getting an error for my custom model. Can you please suggest me what needs to be changed in order to overcome the error? I followed the same procedure as mentioned in the khadas website.

I have one doubt as my number of classes is 1, I have set the following parameters:

num_class=1;
coco_names[] = {“holes”};

I hope I have set the right parameters above. Please let me know if I am wrong.


Thank you in advance! @Dhruv_Gaba Do you have an iddea?
Did you face this issue while converting your custom model?

@suixing Yes, you need to unzip first

1 Like

@Frank @numbqq I decided to check and install the reuirements again to build the code using the SDK tool. During this process, I read in the document that, Python requires version 3.5.2. I got to know that in my system, Python version is 3.6.9. Does this cause any problem? Please find the attached screenshot.

If this does not cause problem, please let me know a solution for the above problem. VIM3 yolov3 convert issue - #39 by Akkisony

Thank you!

@Akkisony Can you check with origin source code ? Don’t do any modifiy.

@Frank I can run the demo without any problem. After demo started to work, I have just started to follow your guide and I am trying to convert my own yolov3 model. I have replaced the .cfg file and .weights file and have followed every instrcution as per the manual. Yet, I am not able to use the NPU. :frowning:

Are my above two statements correct?