A tensorflow2 implementation of some basic CNNs(MobileNetV1/V2/V3, EfficientNet, ResNeXt, InceptionV4, InceptionResNetV1/V2, SENet, SqueezeNet, DenseNet, ShuffleNetV2, ResNet).
526
stars
178
forks
source link
[DenseBlock] ValueError: tf.function-decorated function tried to create variables on non-first call. #13
Closed
taffy128s closed 4 years ago
Hello!
Sorry to bother you.
It seems that creating layers inside 'call' function in a custom layer inheriting from tf.keras.layers.Layer is not proper.
The problem happens when I use your codes as libraries and then I do model.fit with model checkpoint call-back function.
Also, custom layers inheriting from tf.keras.layers.Layer should include get_config as well, or some errors will happen while saving, too.
I've fixed them like below:
Please fix them if you are free! Thank you!