自定义tf.keras.Model需要注意的点 model.save() subclass Model 是不能直接save的,save成.h5,但是能够save_weights,或者save_format="tf" NotImplementedError: Saving the model to HDF5 format requires the model to be a Functional model or a Sequential model. It does not work…
运行以下类似代码: while True: inputs, outputs = get_AlexNet() model = tf.keras.Model(inputs=inputs, outputs=outputs) model.summary() adam_opt = tf.keras.optimizers.Adam(learning_rate) # The compile step specifies the training configuration. model.compile(opt…