Closed ziyigogogo closed 5 years ago
I uploaded B4 and B5 weights a few moments ago. Could you try them out?
Hi @titu1994 , thank you for the quick action. And just to tell you that there are some small typos about the file name(like h5.h5 or notoph5 ) in https://github.com/titu1994/keras-efficientnets/blob/master/keras_efficientnets/efficientnet.py(line438,451,464 and 490). And thank you again for your work about the h5 weights.
@titu1994 I have tried out b4, b5 weights and they are working good except the typos in path. And also, i noticed that in your code you ignored the "endpoints" returned by the official implementation.
Since i am using efficient net as a feature extractor for segmentation. Thus, I modified some of your codes to enabled the "endpoints" again. However, I am using tf2.0-beta right now, so there are some small modifications such as change "rf.random_uniform" to "tf.random.uniform". I don't think it's suitable to make a pull request directly to your repo.
Thus i come up with another idea to enable your repo with the "endpoints" feature without any modification on the code but maybe just a quick example in the readme file.
Since we could get the model layers by layer name like this:
base = efficientnet.EfficientNetB7(input_tensor=input_tensor, include_top=None)
layer_names = ['add_2', 'add_8', 'add_14', 'add_32', 'add_47']
reduction_layers = [ base.get_layer(layer_name).output for layer_name in layer_names ]
...
#then use the reduction layers as the extracted features to build a mark-rcnn, unet, fpn etc.
Since in my modification, i have done this, so you don't have to do the same thing as me again if you know the reduction layer names for b0-b7:
b0_layer_names = ['batch_normalization_2', 'add', 'add_1', 'add_5', 'batch_normalization_47']
b1_layer_names = ['add', 'add_2', 'add_4', 'add_10', 'add_15']
b2_layer_names = ['add', 'add_2', 'add_4', 'add_10', 'add_15']
b3_layer_names = ['add', 'add_2', 'add_4', 'add_12', 'add_18']
b4_layer_names = ['add', 'add_3', 'add_6', 'add_16', 'add_24']
b5_layer_names = ['add_1', 'add_5', 'add_9', 'add_21', 'add_31']
b6_layer_names = ['add_1', 'add_6', 'add_11', 'add_25', 'add_37']
b7_layer_names = ['add_2', 'add_8', 'add_14', 'add_32', 'add_47']
I have double checked the layers' shape so you don't have to worry about. Hope this helps.
Hi Titu, since the official repo released the new weights, can you please share the new .h5 file? Or, is there any tutorial link for how the translate the ckpt file to h5? Thank you so much.