Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confusion over workflow #274

Open
lpkoh opened this issue Nov 23, 2021 · 3 comments
Open

Confusion over workflow #274

lpkoh opened this issue Nov 23, 2021 · 3 comments

Comments

@lpkoh
Copy link

lpkoh commented Nov 23, 2021

HI I would like to run the demo with my own custom yolov4 model.

Is it that I have to make sure that there is a test_nn folder in the build folder before I run, say ./demo?
This test_nn folder, can be generated either by 1) running a ./test_yolo4 in build or 2) exporting weights from darknet and then copying the layer and debug files into a test_nn folder I create myself, right?

@perseusdg
Copy link
Contributor

Its more along the lines of the second method you mentioned,and you might need to slightly modify the test_yolo4(yolo4.cpp) file to use the cfg and name files used to train your custom network,and also point out the exact debug layers needed for comparison

@lpkoh
Copy link
Author

lpkoh commented Nov 23, 2021

Ah. Could I clarify how this works?

So I see when I just go straight to build folder and run test_yolo4, it generates a yolo4 folder that contains a debug and layers folder, containing the binaries. It also generates a yolo4_fp32.rt. With this rt file, I can then proceed to run the demo.

So for my own custom model, e.g. yolo4_x, I would first export the weights using yolo4x.cfg and yolo4x.weights, create a folder called yolo4x in build, copy in the debug and layers from the prevous export. After that, I would need to run ./test_yolo4x to generate an rt file (like ./test_dla34_cnet3d). This test_yolo4x would be generated by copying the yolo4.cpp, and altering things like input, output, cfg path, etc.

I have 2 follow up questions:

  1. How do I go from yolo4x.cpp to test_yolo4? Is it like saving the file in a different format or something? I notice I am able to open the yolo4.cpp file in vim, but unable to do so for test_yolo4. In fact I can't open it and have no idea what is actually inside.
  2. My retrained model does not alter the architecture, but merely edits the anchors as well as the number/type of classes (I am training off darknet). Would this lead to any changes in the output layers?

@perseusdg
Copy link
Contributor

perseusdg commented Nov 23, 2021

1)test_yolo4 is the compiled version of yolo4.cpp , since you are using yolo4x modifying this file should do the trick
2) i don't think there would be any changes in the output layers,just modifying the cfg and name path( to the ones you used to train the network should do the trick) in the yolo4x.cpp file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants