Yolov3 - Trying to implement on the Khadas VIM3 to utilize the NPU

@Frank Hey Frank,
I want to try the yolov3 model and optimize it using the NPU. Now, I have followed the documentation as per the khadas documents. I have modified the all the .sh files as per the instructions. When I run the bash command, I get this error.
Please find the attached screenshot.

Thank you for your help!

@Frank Could you please help me to solve the above problem?

Hello, Most of the Khadas Team are on holiday through 05 May. As a result, I assume it might be a few days before Frank is able to assist.

@RDFTKV Thank you very much for informing!

1 Like

@Frank I am facing an issue executing - “2_export_case_code.sh”.

  1. Please see the first screenshot - “02-ShellScriptError-1”. The script is unale to delete the *.c, *.h and all other files mentioned in the shell script.

  2. In order to make sure the binary file(ovxgenerator) is performing correctly, I went into the location of the binary file and executed it passing all the parameters (–model-input, --data-input, --reorder channel etc.) as defined in the shell script.
    The output of the following is in the second screenshot - “02-ShellScriptError-2”.

  3. “mv ./*nbg_unify nbg_unify${NAME}” - This line in the shell script confused me, as the directory nbg_unify_yolov3 is still not created. So how is it possible to copy files without the directory being created?


    Please guide me so that I can generate the .nb file and run the model on the KHADAS VIM3 board.

@Akkisony Have you made any changes to the SDK? It seems that some files are missing, causing the compilation to fail.

@Frank I haven’t made any changes to the SDK! I modified only the path in the shell script as, I was getting the error as seen in the attached screenshot. So, I modified the path, so that it could find the path of the binary file(ex: ovxgenerator).

@Akkisony Can the original SDK run? Before modification

@Frank I downloaded the sdk file again and changed the parameters as per the documentation to convert yolov3 model. Surprisingly, i did not get any error like I got previously about the path issue. This time “0_import_model.sh” and “1_quantize_model.sh” ran without any issues(no complaints about the path issue). However, “2_export_code.sh” has the same issues. Please find the screenshot.

@Akkisony I think you should check mobilenet first ,don’t do any modified.

@Frank Sure… I’ll try that…Thank you!

@Akkisony OK, and you can faceback there

@Frank I ran the bash command for mobile net

and found this result.

@Akkisony OK,SDK is no problem.

  1. Please make sure you have installed all dependencies according to the documentation.
  1. Please post all your changes here, let me see what went wrong.

Hey @Frank When I modified the shell scripts as per the instructions, I am getting an error while running 01_quantize_model.sh script. Please find the attached scrren shot of the error aswell as the modifications, made by me.

@Akkisony the channel mean is 0 0 0 256

2 Likes

@Frank Thank you! :slight_smile:

@Frank Hey Frank… I will be trying to implement a MobileNet on the VIM3 board. In order to utilize the NPU, is it necessary for the code to be written only in C++? Can’t python code to used ? I will be using existing model and weights and will just be altering the final layer.

Or is there a away where a python code can also be used to utilize the NPU?

When implementing an own model, what might be the required changes that needs to be modified to get the model running on VIM3?

@Akkisony Hey, you can use ctypes in python, as long as you use ctypes to call and dock the API interface of the NPU, you can use python for the subsequent application code .

The python version has entered the plan list, you can also wait for the python version

@Frank Can you please tell me how long will it take for the python version to be released? I am eagerly waiting for the python version!

Also, when I run the Yolov3 model, I am getting the following error when I execute “./build.sh”. Hence, I am not getting the bin_r directory.
Please find the attached screenshot.