Skip to content
This repository was archived by the owner on Aug 30, 2021. It is now read-only.
This repository was archived by the owner on Aug 30, 2021. It is now read-only.

NotImplementedError: Layer PixelSoftmax has arguments in __init__ and therefore must override get_config. #2

Description

@Nickruti

While running main.py, I came across this issue NotImplementederror. The first epoch works perfectly fine but after that, this is what it looks like. I am using Tensorflow 2.2.

Epoch 1/100
24/24 [==============================] - ETA: 0s - loss: 1.4663 - accuracy: 0.5142
Epoch 00001: val_loss improved from inf to 2.40395, saving model to A.hdf5
Traceback (most recent call last):
  File "main.py", line 278, in <module>
    train(args)
  File "main.py", line 202, in train
    model.fit(trainX,
  File "C:\Python38\lib\site-packages\tensorflow\python\keras\engine\training.py", line 66, in _method_wrapper
    return method(self, *args, **kwargs)
  File "C:\Python38\lib\site-packages\tensorflow\python\keras\engine\training.py", line 876, in fit
    callbacks.on_epoch_end(epoch, epoch_logs)
  File "C:\Python38\lib\site-packages\tensorflow\python\keras\callbacks.py", line 365, in on_epoch_end
    callback.on_epoch_end(epoch, logs)
  File "C:\Python38\lib\site-packages\tensorflow\python\keras\callbacks.py", line 1177, in on_epoch_end
    self._save_model(epoch=epoch, logs=logs)
  File "C:\Python38\lib\site-packages\tensorflow\python\keras\callbacks.py", line 1214, in _save_model
    self.model.save(filepath, overwrite=True)
  File "C:\Python38\lib\site-packages\tensorflow\python\keras\engine\network.py", line 1051, in save
    save.save_model(self, filepath, overwrite, include_optimizer, save_format,
  File "C:\Python38\lib\site-packages\tensorflow\python\keras\saving\save.py", line 134, in save_model
    hdf5_format.save_model_to_hdf5(
  File "C:\Python38\lib\site-packages\tensorflow\python\keras\saving\hdf5_format.py", line 109, in save_model_to_hdf5
    model_metadata = saving_utils.model_metadata(model, include_optimizer)
  File "C:\Python38\lib\site-packages\tensorflow\python\keras\saving\saving_utils.py", line 155, in model_metadata
    raise e
  File "C:\Python38\lib\site-packages\tensorflow\python\keras\saving\saving_utils.py", line 152, in model_metadata
    model_config['config'] = model.get_config()
  File "C:\Python38\lib\site-packages\tensorflow\python\keras\engine\network.py", line 968, in get_config
    return copy.deepcopy(get_network_config(self))
  File "C:\Python38\lib\site-packages\tensorflow\python\keras\engine\network.py", line 2119, in get_network_config
    layer_config = serialize_layer_fn(layer)
  File "C:\Python38\lib\site-packages\tensorflow\python\keras\utils\generic_utils.py", line 275, in serialize_keras_object
    raise e
  File "C:\Python38\lib\site-packages\tensorflow\python\keras\utils\generic_utils.py", line 270, in serialize_keras_object
    config = instance.get_config()
  File "C:\Python38\lib\site-packages\tensorflow\python\keras\engine\base_layer.py", line 634, in get_config
    raise NotImplementedError('Layer %s has arguments in `__init__` and '
NotImplementedError: Layer PixelSoftmax has arguments in `__init__` and therefore must override `get_config`.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions