How to get layer weight while training?
问题 I have a model and I would like to get the weight matrix of a specific layer to use it while defining custom loss function. Is there any way to get a weight of specific layer, inside the model? P.S. I am currently working with tensorflow 2, and keras functional API. I tested How do I get the weights of a layer in Keras? approach, but it did not work. P.P.S. By using the above described approach, I get the following error: AttributeError Traceback (most recent call last) <ipython-input-26