Describe the bug
Keras model compiled with WeightedKappaLoss errors when saving, "TypeError: ('Not JSON Serializable:', tf.float32)"
Code to reproduce the issue
model = Sequential()
model._set_inputs(tf.keras.Input((256,256,3)))
model.add(layers.Dense(6, activation='softmax'))
model.compile(Adam(lr=1e-3), tfa.losses.WeightedKappaLoss(num_classes=6, weightage='quadratic'))
model.save('test')
Thanks for reporting this! It's because tf.dtypes.DType cannot be serializable. IMO, we should not set this as attribute. I'll submit a PR for this. Thank you again for the input.
@WindQAQ Thanks for fixing this! What is the release cycle like for this repo? I can use from master from now but would be useful to know when the next release would likely get tagged
@WindQAQ Thanks for fixing this! What is the release cycle like for this repo? I can use from master from now but would be useful to know when the next release would likely get tagged
Hi @ConnorBarnhill, we might pin tensorflow-addons 0.11 to tensorFlow 2.3. If you want to try the new stuff on master branch, you can use our daily build via pip install tfa-nightly. Thank you again for reporting the issue. We really appreciate it!
Most helpful comment
Hi @ConnorBarnhill, we might pin tensorflow-addons 0.11 to tensorFlow 2.3. If you want to try the new stuff on master branch, you can use our daily build via
pip install tfa-nightly. Thank you again for reporting the issue. We really appreciate it!