Closed kaishijeng closed 6 years ago
@kaishijeng Yes, it does. You can make the changes you want to the backend.py.
I added alpha value to MobileNet in the backgroud below. But it encounters an error due to no corresponding backend weight for alpha=0.25. Where can I get "mobilenet_backend.h5" for alpha =0.25?
class MobileNetFeature(BaseFeatureExtractor): """docstring for ClassName""" def init(self, input_size): input_image = Input(shape=(input_size, input_size, 3))
mobilenet = MobileNet(input_shape=(224,224,3), alpha=0.25, include_top=False)
mobilenet.load_weights(MOBILENET_BACKEND_PATH)
Error:
Traceback (most recent call last):
File "train.py", line 140, in
@kaishijeng Unfortunately, I don't the weights for alpha=0.25. You can train it on coco 2014 (cocodataset.org/#detections-challenge2017).
@experiencor
Can I use pretrained mobilenet models from Keras (see link below)? https://keras.rstudio.com/articles/applications.html
If not, why? How can I train myself?
Also I compared your pretained mobilenet_backend model with Keras mobilenet alpha=1.0 pretained model and find both file sizes are different.
Thanks,
Yes, you should start with Keras pre-trained models. The steps: Keras pre-trained model (no top) => train on COCO (then keep only the backend) => train on your custom dataset. It's a quite simple if you know how to manipulate the weights of different layers in Keras.
They are different in sizes because the mobilenet_backend does not include the top layer as in the Keras model.
What do you mean "then keep only the backend" and how I do it?
Thanks
On Mon, Jan 8, 2018 at 4:44 AM, Huynh Ngoc Anh notifications@github.com wrote:
Yes, you should start with Keras pre-trained models. The steps: Keras pre-trained model (no top) => train on COCO (then keep only the backend) => train on your custom dataset. It's a quite simple if you know how to manipulate the weights of different layers in Keras.
They are different in sizes because the mobilenet_backend does not include the top layer as in the Keras model.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/experiencor/basic-yolo-keras/issues/116#issuecomment-355956886, or mute the thread https://github.com/notifications/unsubscribe-auth/AMGg3s19wHp2HiTx4neXLZ05NsR4Pbinks5tIg2WgaJpZM4RVF0Q .
@kaishijeng Object detection model has backend part and frontend part. The backend is the same for all input image sizes and all number of classes. The size of the frontend depends on the number of classess. After you train on COCO, the frontend is for 80 classess. You need to train a new frontend if your custom data does not have 80 classes. In this case, you need to save the weight of the backend trained on COCO and use it on your dataset.
@experiencor
Does current code support different values of Alpha and Depth_Multiplier in Mobilenet?
def MobileNet(input_shape=None, alpha=1.0, depth_multiplier=1, dropout=1e-3, include_top=True, weights='imagenet', input_tensor=None, pooling=None, classes=1000):
Thanks,