Coder Social home page Coder Social logo

compress_yolo's People

Contributors

hjimce avatar jimce avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

compress_yolo's Issues

same model size

Do you need to change the setting in CFG file to prune the model? Setting "prune=1" in makefile only is not helping the model reduction. What else changes do I have to make? Thanks.

关于在GPU下运行

在运行您的代码时,我发现在GPU下运行不会进入prune_convolutional_layer这个函数。在GPU下运行,更新网络参数是运行update_network_gpu这个函数,而不是update_network这个函数。请问一下可以在GPU上运行吗,还是说需要在network_kernels.cu文件里添加相应的函数?

请问您能具体描述一下修改了哪些地方?

你好,感谢您的分享,我可以很顺利的训练原版的darknet,但是我在使用你的库的时候遇到了几个问题:

  • 您的库是在训练过程中来对权重文件进行剪枝,还是说直接对已经训练好的权重文件进行剪枝
  • 我使用的是yolov3-spp.cfg文件,但是运行:
./darknet detector train cfg/voc.data cfg/yolov3-spp.cfg yolov3-spp_110000.weights

遇到以下报错:

   88 conv     24  1 x 1 / 1    21 x  21 x1024   ->    21 x  21 x  24
   89 Type not recognized: [yolo]
Unused field: 'mask = 6,7,8'
Unused field: 'anchors = 10,13,16,30,33,23,30,61,62,45,59,119,116,90,156,198,373,326'
Unused field: 'classes = 3'
Unused field: 'num = 9'
Unused field: 'jitter = .3'
Unused field: 'ignore_thresh = .7'
Unused field: 'truth_thresh = 1'
Unused field: 'random = 1'
   90 route  86
   91 conv    256  1 x 1 / 1    21 x  21 x 512   ->    21 x  21 x 256
   92 Type not recognized: [upsample]
Unused field: 'stride = 2'
   93 route  92 61
   94 Layer before convolutional layer must output image.: Cannot allocate memory
darknet: ./src/utils.c:224: error: Assertion `0' failed.
Aborted (core dumped)

因此我猜测,您没有实现upsample yolo等层,对吗?

  • 之后我又尝试了yolov3-tiny.cfg,也遇到相似的问题

所以想问问您具体修改的情况,非常感谢(ps: 如果能出教程就更好了:happy)

使用过程中的一些问题

您好,我对您在yolo上进行剪枝的工作非常感兴趣。我下载了您的源码进行测试,但是好像没有cfg文件夹。我直接用yolo作者github的cfg,但是并没有tiny-yolo.cfg这个文件,请问您是对yolov1-tiny.cfg进行的剪枝吗?是否是直接把作者的cfg文件夹拷贝过去就可以运行了呢?

Huffman coding implemented

@hjimce @Jimce Hi thanks for the code base i tried your source code base for the tiny yolo and the mode size remained the same can you please let me knwif you have implmented the huffman coding into ur code base
2. How did ur model size decerease from 64M to 18M
3. What is the fps you have achieved by pruning the model was there any drop in the accuracy of the model and the mAP values

压缩的时候出现这样的错误

(base) wupeng@ubuntu:/data_ssd/yolo/Vehicle/tiny-yolo$ /data_ssd/compress_yolo/darknet detector train voc.data yolov3-tiny.cfg backup/yolov3-tiny_130000.weights -gpus 0
0
yolov3-tiny
layer filters size input output
0 conv 16 3 x 3 / 1 416 x 416 x 3 -> 416 x 416 x 16
1 max 2 x 2 / 2 416 x 416 x 16 -> 208 x 208 x 16
2 conv 32 3 x 3 / 1 208 x 208 x 16 -> 208 x 208 x 32
3 max 2 x 2 / 2 208 x 208 x 32 -> 104 x 104 x 32
4 conv 64 3 x 3 / 1 104 x 104 x 32 -> 104 x 104 x 64
5 max 2 x 2 / 2 104 x 104 x 64 -> 52 x 52 x 64
6 conv 128 3 x 3 / 1 52 x 52 x 64 -> 52 x 52 x 128
7 max 2 x 2 / 2 52 x 52 x 128 -> 26 x 26 x 128
8 conv 256 3 x 3 / 1 26 x 26 x 128 -> 26 x 26 x 256
9 max 2 x 2 / 2 26 x 26 x 256 -> 13 x 13 x 256
10 conv 512 3 x 3 / 1 13 x 13 x 256 -> 13 x 13 x 512
11 max 2 x 2 / 1 13 x 13 x 512 -> 13 x 13 x 512
12 conv 1024 3 x 3 / 1 13 x 13 x 512 -> 13 x 13 x1024
13 conv 256 1 x 1 / 1 13 x 13 x1024 -> 13 x 13 x 256
14 conv 512 3 x 3 / 1 13 x 13 x 256 -> 13 x 13 x 512
15 conv 18 1 x 1 / 1 13 x 13 x 512 -> 13 x 13 x 18
16 Type not recognized: [yolo]
Unused field: 'mask = 3,4,5'
Unused field: 'anchors = 10,14,23,27,37,58,81,82,135,169,344,319'
Unused field: 'classes = 1'
Unused field: 'num = 6'
Unused field: 'jitter = .3'
Unused field: 'ignore_thresh = .7'
Unused field: 'truth_thresh = 1'
Unused field: 'random = 1'
17 route 13
18 conv 128 1 x 1 / 1 13 x 13 x 256 -> 13 x 13 x 128
19 Type not recognized: [upsample]
Unused field: 'stride = 2'
20 route 19 8
21 Layer before convolutional layer must output image.: File exists
darknet: ./src/utils.c:224: error: Assertion `0' failed.
Aborted (core dumped)

自己训练的一个模型,想压缩一下,但是输入命令出错,不知道哪儿的问题

编译的时候出现错误

./src/convolutional_layer.c: In function ‘cudnn_convolutional_setup’:
./src/convolutional_layer.c:134:5: error: too few arguments to function ‘cudnnSetConvolution2dDescriptor’
cudnnSetConvolution2dDescriptor(l->convDesc, l->pad, l->pad, l->stride, l->stride, 1, 1, CUDNN_CROSS_CORRELATION);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated due to -Wfatal-errors.
Makefile:84: recipe for target 'obj/convolutional_layer.o' failed
make: *** [obj/convolutional_layer.o] Error 1

请问怎么解决呢?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.