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

Failed to prune #1

Open
erikguo opened this issue Aug 23, 2019 · 7 comments
Open

Failed to prune #1

erikguo opened this issue Aug 23, 2019 · 7 comments

Comments

@erikguo
Copy link

erikguo commented Aug 23, 2019

Hello,

I build your darknet by build.sh successfully. Then I use 'darknet prune' command to prune my yolo3-spp. But I always failed when calculating pruning to layer 76.

Do I miss some thing ?

Thank you for your help

@gmayday1997
Copy link
Owner

thank you. I will check this fault tomorrow.

@anhuipl2010
Copy link

@gmayday1997 when the layer conv-->max pool->route, the conv layer need net.layers[i+1] & net.layers[i+2], net.layers[i+2] is route layer, net.layers[i+2].biases is null, prune may make some mistake.

@gmayday1997
Copy link
Owner

@erikguo @anhuipl2010 thanks for pointing this. I have fixed this bug, and it works well now.
If you want to prune more parameters, you can set -shuffle equal 1, which means random pruning.
On the basis of my experiment results, there is really little gap between random pruning and bn-scale pruning.

./darknet prune ./cfgfile ./weightsfile -rate 0.4 -shuffle 1

@anhuipl2010
Copy link

@gmayday1997 u are handsome. do u add sparsity train code for the last update?

@anhuipl2010
Copy link

@gmayday1997 your code fopen() function in prune, maybe take some mistake. maybe you can changed it to fopen("xxxx", "wb"); or fopen("xxxx", "w");

@gmayday1997
Copy link
Owner

@anhuipl2010 thanks, I fixed that. 😄 😊

@varghesealex90
Copy link

@erikguo can you please let me know how you installed this repo.

I git cloned this repo,

  1. make clean
  2. make
  3. sh build.sh

[ 96%] Building CUDA object CMakeFiles/dark.dir/src/im2col_kernels.cu.o
/mnt/darknet.CG/src/im2col_kernels.cu:125:18: warning: "/" within comment [-Wcomment]
//data_col_ptr = (h >= 0 && w >= 0 && h < height && w < width) ?
^
/mnt/darknet.CG/src/im2col_kernels.cu:1178:6: warning: "/" within comment [-Wcomment]
//((uint64_t )(A_s + (local_ilda + k) / 8)) = ((uint64_t )(A + (i_curlda + k) / 8)); // weights
^
CMakeFiles/darknet.dir/src/darknet.c.o: In function main': darknet.c:(.text.startup+0x70c): undefined reference to run_prune'
collect2: error: ld returned 1 exit status
CMakeFiles/darknet.dir/build.make:1318: recipe for target 'darknet' failed
make[2]: *** [darknet] Error 1
CMakeFiles/Makefile2:133: recipe for target 'CMakeFiles/darknet.dir/all' failed
make[1]: *** [CMakeFiles/darknet.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 96%] Building CUDA object CMakeFiles/dark.dir/src/maxpool_layer_kernels.cu.o
[ 97%] Building CUDA object CMakeFiles/dark.dir/src/network_kernels.cu.o
/mnt/darknet.CG/src/im2col_kernels.cu:125:18: warning: "/" within comment [-Wcomment]
//data_col_ptr = (h >= 0 && w >= 0 && h < height && w < width) ?
^
/mnt/darknet.CG/src/im2col_kernels.cu:1178:6: warning: "/" within comment [-Wcomment]
//*((uint64_t )(A_s + (local_ilda + k) / 8)) = *((uint64_t )(A + (i_curlda + k) / 8)); // weights
^
[ 98%] Linking CUDA device code CMakeFiles/dark.dir/cmake_device_link.o
[ 98%] Linking CXX shared library libdark.so
[ 98%] Built target dark
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
cp: target 'share/darknet/' is not a directory

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

4 participants