Closed qxde01 closed 5 years ago
@qxde01, Thank you for trying Keras. Currently, the function densenet
is designed for internal generic function, thus you can't use it directly. If you want to customize the numbers of dense blocks, you can use the following workarounds:
from keras_applications import densenet
from keras.applications import keras_modules_injection
@keras_modules_injection
def yourDenseNet(*args, **kwargs):
return densenet.DenseNet(*args, **kwargs)
model = yourDenseNet(blocks=[2,2,2,2], weights=None)
@taehoonlee thank you. It can be solved as follows:
x=Input(shape=(224,224,3))
model=densenet.DenseNet(blocks=[2,2,2,2],weights=None,input_tensor=x,backend=keras.backend,layers=keras.layers,...)
@qxde01, Yes, that is also possible. Thank you!
or