keras-io icon indicating copy to clipboard operation
keras-io copied to clipboard

VAE.py: Training with validation split

Open bryanongwx opened this issue 4 years ago • 0 comments
trafficstars

Hi there, I've been following the Keras VAE code example found here and am trying to train the model against validation data. However, the following error is outputted instead:

NotImplementedError: in user code:

/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/training.py:1323 test_function  *
    return step_function(self, iterator)
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/training.py:1314 step_function  **
    outputs = model.distribute_strategy.run(run_step, args=(data,))
/usr/local/lib/python3.7/dist-packages/tensorflow/python/distribute/distribute_lib.py:1285 run
    return self._extended.call_for_each_replica(fn, args=args, kwargs=kwargs)
/usr/local/lib/python3.7/dist-packages/tensorflow/python/distribute/distribute_lib.py:2833 call_for_each_replica
    return self._call_for_each_replica(fn, args, kwargs)
/usr/local/lib/python3.7/dist-packages/tensorflow/python/distribute/distribute_lib.py:3608 _call_for_each_replica
    return fn(*args, **kwargs)
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/training.py:1307 run_step  **
    outputs = model.test_step(data)
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/training.py:1266 test_step
    y_pred = self(x, training=False)
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/base_layer.py:1030 __call__
    outputs = call_fn(inputs, *args, **kwargs)
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/training.py:476 call  **
    raise NotImplementedError('When subclassing the `Model` class, you should '

NotImplementedError: When subclassing the `Model` class, you should implement a `call` method.

Is there any workaround or should I use another model instead? Thank you!

bryanongwx avatar Jun 17 '21 13:06 bryanongwx