Giter Site home page Giter Site logo

Comments (11)

TianSong1991 avatar TianSong1991 commented on May 21, 2024 1

Oh thank you very much! @PiyalGeorge

from mobilenet-yolo.

eric612 avatar eric612 commented on May 21, 2024

mobilenet_yolov3_lite_deploy.prototxt was made from merge_bn.py , you can't use it directly.

I suggest you can try modify test.prototxt to deploy.prototxt first (replace data layer and remove eval. layer)

from mobilenet-yolo.

PiyalGeorge avatar PiyalGeorge commented on May 21, 2024

Thanks @eric612 , I'll try that.
Also while training, do i need to change 'num_class', or 'num' anywhere in mobilenet_yolov3_lite_train.prototxt or in test.prototxt based on number of classes i'm training? (Cuz usually we do it right?)

In the last lines -

yolov3_param {
side: 26
num_class: 20
num: 3
......
}

from mobilenet-yolo.

eric612 avatar eric612 commented on May 21, 2024

See issue #12

from mobilenet-yolo.

globalmaster avatar globalmaster commented on May 21, 2024

Hi, @eric612 , Thanks for this amazing repo. Your mobilenet-yolov3-lite model is giving good results with good fps.
Currently following your repo, i'm trying to do training on mobilenet-yolov3-lite with my custom dataset. I'm having 6 classes(including background), 50000 images converted to LMDB. I'm using train_yolov3_lite.sh for training. I modified mobilenet_yolov3_lite_train.prototxt, label_prototxt, LMDB and batch_size in here. My system allows a batch size of only 2 for training and 1 for testing(total 3). I have trained till 50000 iterations. I modified the classes in yolo_detect.cpp , make file, etc. then modified the demo_yolo_lite.sh for the new model. but it caused some convolution 'bias_term' issue in mobilenet_yolov3_lite_deploy.prototxt . Hence modified that deploy file also. After rectifying all these, when i try to run the model, it still doesn't give output, no errors. Can you help me resolve this?

Hi,

Have you solved this problem? Now I'm training on my own dataset and I'm facing the same problem with you. Can you help me resolve this?

Thanks

from mobilenet-yolo.

PiyalGeorge avatar PiyalGeorge commented on May 21, 2024

Hi @eric612 , Extremely sorry for late reply. Thanks alot, your above mentioned methods worked perfectly for custom training and detection. Thanks 😊 😃

from mobilenet-yolo.

PiyalGeorge avatar PiyalGeorge commented on May 21, 2024

Hi @globalmaster , Sorry for the late reply.
Actually all your answers is mentioned by @eric612 , in the above comments. Anyway i'll join all comments and here is what you want:
Hope you have LMDB database of custom dataset with specific classes. I'll explain how i've done with 5 classes(excluding background). For example i have 5 classes(person, dog, cat, car, bus).

In mobilenet_yolov3_lite_train.prototxt, modify:

  • lmdb file path
  • label_map.prototxt
  • Modify 'num_output: 75' in the file as follows:-
    the above 75 was obtained from the calculation (5+classno)*3, where classno is the number of classes(without considering background in the count), and here eric's classno is 20.
    So if you have 5 classes(for eg:- person, dog, cat, car, bus), then the value is (5+5)*3=30, so modify 'num_output: 75' in file to 'num_output: 30'.
  • Search for 'num_class: 20' in the file and modify the value as follows:-
    if you have 5 classes(for eg:- person, dog, cat, car, bus), then modify the value into 'num_class: 5'

In mobilenet_yolov3_lite_test.prototxt, modify:

  • lmdb file path
  • label_map.prototxt
  • Modify 'num_output: 75' in the file as follows:-
    the above 75 was obtained from the calculation (5+classno)*3, where classno is the number of classes(without considering background in the count), and here eric's classno is 20.
    So if you have 5 classes(for eg:- person, dog, cat, car, bus), then the value is (5+5)*3=30, so modify 'num_output: 75' in file to 'num_output: 30'.
  • Modify 'num_classes: 20' to 'num_classes: 5'
  • Modify 'num_classes: 21' to 'num_classes: 6'

Once Training is done:
Modify the MobileNet-YOLO/examples/yolo/yolo_detect.cpp. You need to modify line:
char* CLASSES[21] = { "background", ....., "train", "tvmonitor" };
with classes.

Then once again run make commands:

cd build
cmake ..
make -j4
make pycaffe

Now modify MobileNet-YOLO/demo_yolo_lite.sh . Just now the eric has uploaded new mobilenet_yolov3_lite_deploy.prototxt , https://github.com/eric612/MobileNet-YOLO/blob/master/models/yolov3/mobilenet_yolov3_lite_bn_deploy.prototxt .

In mobilenet_yolov3_lite_bn_deploy.prototxt, modify:-

  • Modify 'num_output: 75' in file to 'num_output: 30' following above same criterias
  • Modify 'num_classes: 20' to 'num_classes: 5'

Now go ahead and run the command bash demo_yolo_lite.sh
Thank you, Hope this helps you

from mobilenet-yolo.

TianSong1991 avatar TianSong1991 commented on May 21, 2024

Hi @globalmaster , Sorry for the late reply.
Actually all your answers is mentioned by @eric612 , in the above comments. Anyway i'll join all comments and here is what you want:
Hope you have LMDB database of custom dataset with specific classes. I'll explain how i've done with 5 classes(excluding background). For example i have 5 classes(person, dog, cat, car, bus).

In mobilenet_yolov3_lite_train.prototxt, modify:

  • lmdb file path
  • label_map.prototxt
  • Modify 'num_output: 75' in the file as follows:-
    the above 75 was obtained from the calculation (5+classno)*3, where classno is the number of classes(without considering background in the count), and here eric's classno is 20.
    So if you have 5 classes(for eg:- person, dog, cat, car, bus), then the value is (5+5)*3=30, so modify 'num_output: 75' in file to 'num_output: 30'.
  • Search for 'num_class: 20' in the file and modify the value as follows:-
    if you have 5 classes(for eg:- person, dog, cat, car, bus), then modify the value into 'num_class: 5'

In mobilenet_yolov3_lite_test.prototxt, modify:

  • lmdb file path
  • label_map.prototxt
  • Modify 'num_output: 75' in the file as follows:-
    the above 75 was obtained from the calculation (5+classno)*3, where classno is the number of classes(without considering background in the count), and here eric's classno is 20.
    So if you have 5 classes(for eg:- person, dog, cat, car, bus), then the value is (5+5)*3=30, so modify 'num_output: 75' in file to 'num_output: 30'.
  • Modify 'num_classes: 20' to 'num_classes: 5'
  • Modify 'num_classes: 21' to 'num_classes: 6'

Once Training is done:
Modify the MobileNet-YOLO/examples/yolo/yolo_detect.cpp. You need to modify line:
char* CLASSES[21] = { "background", ....., "train", "tvmonitor" };
with classes.

Then once again run make commands:

cd build
cmake ..
make -j4
make pycaffe

Now modify MobileNet-YOLO/demo_yolo_lite.sh . Just now the eric has uploaded new mobilenet_yolov3_lite_deploy.prototxt , https://github.com/eric612/MobileNet-YOLO/blob/master/models/yolov3/mobilenet_yolov3_lite_bn_deploy.prototxt .

In mobilenet_yolov3_lite_bn_deploy.prototxt, modify:-

  • Modify 'num_output: 75' in file to 'num_output: 30' following above same criterias
  • Modify 'num_classes: 20' to 'num_classes: 5'

Now go ahead and run the command bash demo_yolo_lite.sh
Thank you, Hope this helps you

@PiyalGeorge
Hi PiyalGeorge, I follow your steps and run sh train_yolov3_lite_self.sh and finally I obtain the caffe model.But when I run python merge_bn.py --model example/mobilenet_yolov3_lite_solver.prototxt --weights snapshot/mydata_deploy_iter_20000.caffemodel
It makes run and the feedback as follow:

Traceback (most recent call last):
File "merge_bn.py", line 60, in
net_deploy = caffe.Net(deploy_proto, caffe.TEST)
RuntimeError: Could not open file /media/pico/data2/kevin/MobileNet-YOLO/data/VOCself/remove_bn.prototxt

Should I create the remove_bn.prototxt first?

from mobilenet-yolo.

PiyalGeorge avatar PiyalGeorge commented on May 21, 2024

Hi @TianSong1991 , haven't you checked eric's latest update? he updated the repo today. There is no need for you to run merge_bn.py, since he has already gave you the file directly. This is the new file eric has added - https://github.com/eric612/MobileNet-YOLO/blob/master/models/yolov3/mobilenet_yolov3_lite_bn_deploy.prototxt .

In mobilenet_yolov3_lite_bn_deploy.prototxt, you need to modify as i specified above.
You also need to modify command in demo_yolo_lite.sh, with mobilenet_yolov3_lite_bn_deploy.prototxt

from mobilenet-yolo.

shuxiao9058 avatar shuxiao9058 commented on May 21, 2024
  • the above 75 was obtained from the calculation (5+classno)*3, where classno is the number of classes(without considering background in the count), and here eric's classno is 20.

@PiyalGeorge
all the 75 in the train file need modify?

from mobilenet-yolo.

PiyalGeorge avatar PiyalGeorge commented on May 21, 2024
  • the above 75 was obtained from the calculation (5+classno)*3, where classno is the number of classes(without considering background in the count), and here eric's classno is 20.

@PiyalGeorge
all the 75 in the train file need modify?

Bro, Yes. Above it specifies to Modify 'num_output: 75' in the file. so search for 'num_output: 75' in the file and modify that only. 😃 😃

from mobilenet-yolo.

Related Issues (20)

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.