I'm using tf.loadLayersModel()
to load into tf.js and get this error:
Error: Layer invocation in the presence of activity regularizer(s) is not supported yet.
I am using an L2 regularizer and to ensure it works properly I am also including this:
class L2 {
static className = 'L2';
constructor(config) {
return tf.regularizers.l2(config)
}
}
tf.serialization.registerClass(L2);
What is the issue?
NOTE: This is a Tensorflow model being moved to Tf.js, but Tf.js supports activity regularizers.
UPDATE:
Here is the source code for the unimplemented error. So is it not possible to load a Keras model with regularizers?
Well, based on the message, and the link to the repo you provided
I looked at my python code and commented
activity_regularizer
parameters intf.keras.layers.Dense()
and it seems to work after generation withtensorflowjs_converter
(at least javascript doesn't show errors).