Coder Social home page Coder Social logo

resnet-generator's Introduction

resnet-generator

Generate Caffe Prototxt for Deep Residual Learning Network

Only support Faster R-CNN network so far, but can be easily changed to support Fast R-CNN, classification network, etc.

Naming conventions of the layers follow the original models.

Examples

  • First, define your network in a file (see resnet50.def)

  • Generate prototxt:

The script has several options, which can be listed with the --help flag.

Generate train/test prototxt for Faster R-CNN, 21 classes (including background):

./resnet_generator.py --cfg resnet50.def -t fasterrcnn --ncls 21

Generate train/test prototxt for Faster R-CNN, finetuning mode:

./resnet_generator.py --cfg resnet50_finetune.def -t fasterrcnn --ncls 21 --finetune

Generate train/test prototxt for Faster R-CNN, finetuning mode, fix BN parameters:

./resnet_generator.py --cfg resnet50_finetune.def -t fasterrcnn --ncls 21 --finetune --fixbn

You can also use the --train-file, --test-file flags to specify the output prototxt files.

resnet-generator's People

Contributors

xiaozhichen 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  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  avatar

resnet-generator's Issues

"batch_norm_param" py-faster r-cnn error

hi.
i have a problem.
training
[libprotobuf ERROR google/protobuf/text_format.cc:274] Error parsing text-format caffe.NetParameter: 35:20: Message type "caffe.LayerParameter" has no field named "batch_norm_param".
F0309 13:19:36.307616 13339 upgrade_proto.cpp:928] Check failed: ReadProtoFromTextFile(param_file, param) Failed to parse NetParameter file: models/RESNET_50//train.prototxt

Do you know this problem?

create 34 layers of resnet

Xiaozhi,

If I want to create resnet-34, network, should I just change # of layers from 50 to 34 in resnet50.def below:

number of layers

50

training result with faster-rcnn

@XiaozhiChen Hi, Xiaozhi. I used your program to create the resnet50's train.prototxt and test.protxt, then trained with faster-rcnn. And I got a very low result on voc2007, about 0.47, even lower than ZF model's 0.62. What's the result you got on voc2007?

Is my solver correct?
base_lr: 0.001
lr_policy: "multistep"
gamma: 0.1
stepvalue: 300000
stepvalue: 500000
display: 20
momentum: 0.9
weight_decay: 0.0001
snapshot: 0

Thank you very much!

error when testing resnet34+fasterrcnn

Hi, Xiaozhi !
Thanks for you generator, I am now working on resnet34+fasterrcnn. I have already got a caffemodel of resnet34+fasterrcnn perfectly. But when I try to test on it, I meet the problem:

Error parsing text-format caffe.NetParameter: 2:15: Message type "caffe.NetParameter" has no field named "ResNet".

I have no idea about it.

question 152 layer

i success 50 layer(~ing...).
but i make def file for 152 layer (based on resnet paper and your examples).
i have a next problem.

-# number of layers
152
-# number of stages from conv2
4
-# definition of stages: conv #block learn_weights
conv 3 0
1 64
3 64
1 256
conv 8 1
1 128
3 128
1 512
conv 36 1
1 256
3 256
1 1024
conv 3 1
1 512
3 512
1 2048

but next error generate,,!

...
I0315 16:46:23.134991 31153 net.cpp:270] This network produces output loss_cls
I0315 16:46:23.134996 31153 net.cpp:270] This network produces output rpn_cls_loss
I0315 16:46:23.135004 31153 net.cpp:270] This network produces output rpn_loss_bbox
I0315 16:46:23.135278 31153 net.cpp:283] Network initialization done.
I0315 16:46:23.136476 31153 solver.cpp:60] Solver scaffolding done.
Loading pretrained model weights from data/imagenet_models/ResNet-152-model.caffemodel
Check failed: target_blobs.size() == source_layer.blobs_size() (2 vs. 1) Incompatible number of blobs for layer conv1
*** Check failure stack trace: ***
중지됨 (core dumped)

do you know this problem? memory size problem ?? hmm
or you try???152 layers? Are you show 152 def (file) examples ??

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.