keras-shufflenetV2 icon indicating copy to clipboard operation
keras-shufflenetV2 copied to clipboard

How to train this network?

Open Richardkang1992 opened this issue 6 years ago • 3 comments

Dear opconty, Thanks for sharing your codes firstly. Of course, I've met some problems when I want to use your codes. Hope that you can help me! Where is the main function to train this network? I've added this shufflenetV2 network into my own objects, but there were always some errors. So, I want to know how do you add this shuffle network into your object. Would you mind sharing your train.py (or something like this) to me?

Richardkang1992 avatar Dec 17 '18 06:12 Richardkang1992

Dear Richardkang: you can use this model like: from shufflenetv2 import ShuffleNetV2

create model

model = ShuffleNetV2(include_top=True, input_shape=(224, 224, 3), bottleneck_ratio=1, classes=1000)

dataloader

compile model

train model

Just same as pretrained models in keras, taking vgg16 for e.g.: In [1]: from keras.applications import VGG16 In [2]: model = VGG16(include_top=True, weights='imagenet', input_shape=(224, 22 ...: 4,3))

Hope this useful.

opconty avatar Dec 18 '18 08:12 opconty

Dear opconty, Thank you for your training methods. Do you have the method of shufflenetv2 transfer learning? If you use this network for transfer learning, how many layers need to be frozen? Hope that you can help me!

yangzijia avatar Oct 24 '19 04:10 yangzijia

this is a transfer learning example: https://github.com/opconty/face_detection_in_realtime

any questions plz let me know. best

opconty avatar Oct 24 '19 06:10 opconty