TimeDistributed of a KerasLayer in Tensorflow 2.0
问题 I'm trying to build a CNN + RNN using a pre-trained model from tensorflow-hub: base_model = hub.KerasLayer('https://tfhub.dev/google/imagenet/resnet_v2_50/feature_vector/4', input_shape=(244, 244, 3) base_model.trainable = False model = Sequential() model.add(TimeDistributed(base_model, input_shape=(15, 244, 244, 3))) model.add(LSTM(512)) model.add(Dense(256, activation='relu')) model.add(Dense(3, activation='softmax')) adam = Adam(learning_rate=learning_rate) model.compile(loss='categorical