Darknet: Modifying darknet to support MobileNet V2

Created on 14 Mar 2019  路  5Comments  路  Source: AlexeyAB/darknet

Hi @AlexeyAB,

I am currently working on modifying darknet to support a XNORNet version of MobileNet V2. A version of Google's MobileNet V2 is already implemented in this repo: https://github.com/WePCf/darknet-mobilenet-v2

My goal here is to port the modifications to your version of darknet so I can binarize the network and use your xnor acceleration.

I've tried to reproduce the changes that were made to darknet in the repo I mentioned above (they are described in the README.md, and they are quite clear) on your repo. However, although your version of darknet runs with the configuration file in that repo and all, the produced results do not make any sense, and inclusively, there is an option called groups, which is supported by pjreddie repo that is not supported in yours. I am quite sure that I am close to having this working, but I am a little bit clueless about what might be causing the wrong results. Can you help me out with this?

want enhancement

Most helpful comment

@AlexeyAB,

I am sorry if I am being redundant, but I saw that dephwise convolution was added here:
pjreddie@fbd48ab#diff-ae59d70b262c4fc38e33107897434688

Can you merge it in your repo?

Thanks in advance!

All 5 comments

@joaomiguelvieira Hi,

At what step are you now?

We can make it in such a way.

  1. Step-1: At first you can try to implement Depthwise (Group) Convolution for Floats and test it:
  2. https://github.com/AlexeyAB/darknet/issues/1730
  3. https://github.com/mratsim/Arraymancer/issues/128

After that you can try to train and test it for XNOR models with commented these lines and test it:

Then just you can make your 1st Pull Request that I will merge.


Step-2: Then you can try to add here:

Such loops: https://github.com/pjreddie/darknet/commit/fbd48ab606dd91f076eaa68588f285c1d5f436fb#diff-ae59d70b262c4fc38e33107897434688R110

And test it, if it works successfully - then just do 2nd Pull Request.
It isn't an optimal implementation on CUDA, but it shows that all other is done correctly.


Step-3: Then I will try to implement to on CUDA for an optimal way (or you can try to do it by yourself):

  • and here: gemm_nn_custom_bin_mean_transposed_gpu_kernel

Hi @AlexeyAB,

I thought that group convolution was already implemented since such option is supported in pjreddie repo. However, if it is not, it seems that I am back to Step-1.

I also want to implement group conv in darknet.
I try to modify the code ( code.zip )
I can compile it successful, but when I use command:
./darknet classifier train cfg/aoi.data cfg/mobilenetv2_groups.cfg training it
I get:
core_dumped

However, If I delete "groups" in cfg it can be executed normally.

Can anyone help me?
thanks a lot.

@AlexeyAB,

I am sorry if I am being redundant, but I saw that dephwise convolution was added here:
pjreddie@fbd48ab#diff-ae59d70b262c4fc38e33107897434688

Can you merge it in your repo?

Thanks in advance!

Hi, it has been validated by anyone? depthwise convoltion is supported in pjreddie/darknet or this repo?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

yongcong1415 picture yongcong1415  路  3Comments

hemp110 picture hemp110  路  3Comments

Greta-A picture Greta-A  路  3Comments

Cipusha picture Cipusha  路  3Comments

jasleen137 picture jasleen137  路  3Comments