MATLAB Answers

Not able to find weights/bias files generated by GPU coder when calling .so (DLL)

조회 수: 5(최근 30일)
Song Decn
Song Decn 8 May 2020
I generated c++ source codes from a trained model and build them into .so DLL.
Then I copied this DLL file XXX.so (without the weights/biases files of DL model) into my generated execuable and invoke the DL interface function from the executable.
Then I get following error from debug window:
Camera image with 1920x1080 at 30 FPS
terminate called after throwing an instance of 'std::runtime_error'
what(): Unable to find the cnn_resnet50_yolov2_SPB_detector_input_1_scale binary file in ./codegen/dll/sbd_yolov2_detect .
It seems that within .so file the absolute path of weights and biases files are memorized.
Or does anyone know how to solve the problem?
Is it possible to put all weights/biases of DL model into .so?
Another question is for the network parameter path "./codegen/dll/sbd_yolov2_detect"
where is exactly the start point? Is it where the .so DLL is, or where the executable is?
Thanks

  댓글 수: 0

댓글을 달려면 로그인하십시오.

답변(1개)

Nathan Malimban
Nathan Malimban 8 May 2020
Hi Song,
The network parameter path you mention is relative to the current working directory. No matter where your executable is, if your current working directory has the "codegen" folder and you call the executable from this current working directory, the application will be able to find the weight and bias binary files.
If, in the current working directory, the "codegen" folder is not found, it will instead search for each individual binary file in the current working directory. Thus, if you call your executable from a directory containing all the binary files, your application will manage to find the binary files in this scenario also.
So you can do two things:
  1. Cd to the directory containing the "codegen" folder (or the directory within the "codegen" folder containing the binary files) and call your executable from there.
  2. Copy the entire "codegen" folder (or just copy all of the binary files within the "codegen folder") to the directory you wish to call your executable from. Then call your executable from that directory.
Nathan

  댓글 수: 0

댓글을 달려면 로그인하십시오.

태그

제품


릴리스

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by