【发布时间】:2021-04-11 12:42:25
【问题描述】:
inputs = tf.keras.layers.Input(shape=(32,32,3))
resize = tf.keras.layers.UpSampling2D(size=(7,7))(inputs)
feature_extractor = tf.keras.applications.resnet.ResNet50(input_shape=(224, 224,3),include_top=False,weights='imagenet')(resize)
feature_extractor.summary()
上面的代码导致错误AttributeError: 'KerasTensor' object has no attribute 'summary。
但是,如果我从 ResNet50() 中删除 resize 参数,如下所示,它会显示摘要而没有错误。为什么?
tf.keras.applications.resnet.ResNet50(input_shape=(224, 224, 3),
include_top=False,
weights='imagenet')
【问题讨论】:
标签: tensorflow keras transfer-learning