我在TensorFlow中设计了一个带有自定义层的神经网络。首先,我使用__call__()来定义前传,然后调用model.summary()。这给了我以下错误
ValueError: This model has not yet been built.Build the model first by calling `build()` or calling `fit()` with some data, or specify an `input_sh
当我试图保存和加载包含LSTM层的模型时,ValueError:未能找到从SavedModel加载的匹配函数,加载逗号失败了。='sigmoid', return_sequences=True)regNet.save(regNet_ckpt_dir, save_format='tf')
# Recreate the exact s
我考虑过的一些方法: 从模型类Sampled softmax in tensorflow keras继承 从Layers类How can I use TensorFlow's sampled softmax继承 在这两种方法中,模型方法更清晰,因为层方法有点老生常谈-它将目标作为输入的一部分,然后再见多输出模型。我希望在model类的子类</em