tensorflow / addons

Useful extra functionality for TensorFlow 2.x maintained by SIG-addons
Apache License 2.0
1.69k stars 611 forks source link

WeightNormalization save fails with Conv1DTranspose #2795

Open binbinxue opened 1 year ago

binbinxue commented 1 year ago

System information

Describe the bug

WeightNormalization(Conv1DTranspose(...)) will cause an error when saving the model in tf format

A clear and concise description of what the bug is.

ValueError: Unable to save function b'__inference_conv1d_transpose_3_layer_call_and_return_conditional_losses_101006' because it captures graph tensor Tensor("weight_normalization_21/compute_weights/mul:0", shape=(16, 32, 64), dtype=float32) from a parent function which cannot be converted to a constant with tf.get_static_value.

Code to reproduce the issue From official tutorial https://keras.io/examples/audio/melgan_spectrogram_inversion/ Provide a reproducible test case that is the bare minimum necessary to generate the problem.

Other info / logs

Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.