Accessing layer's input/output using Tensorflow 2.0 Model Sub-classing
问题 Working on a university exercise, I used the model sub-classing API of TF2.0. Here's my code (it's the Alexnet architecture, if you wonder...): class MyModel(Model): def __init__(self): super(MyModel, self).__init__() # OPS self.relu = Activation('relu', name='ReLU') self.maxpool = MaxPooling2D(pool_size=(3, 3), strides=(2, 2), padding='valid', name='MaxPool') self.softmax = Activation('softmax', name='Softmax') # Conv layers self.conv1 = Conv2D(filters=96, input_shape=(224, 224, 3), kernel