I am using resnet50 pre-trained model for inference. I replace Conv2D layers with my custom layer. Inference works fine but when I save the modified model in ".h5" format, I get the following error. I am using 2.7.0 version of keras and tensorflow.
Any clues to debug will definitely help.
Traceback (most recent call last):
File "imagenet_sonos_inference.py", line 358, in <module>
model.save('temp.h5')
File "\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\keras\utils\traceback_utils.py", line 67, in error_handler
raise e.with_traceback(filtered_tb) from None
File "\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\h5py\_hl\group.py", line 148, in create_dataset
dsid = dataset.make_new_dset(group, shape, dtype, data, name, **kwds)
File "\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\h5py\_hl\dataset.py", line 137, in make_new_dset
dset_id = h5d.create(
parent.id, name, tid, sid, dcpl=dcpl)
File "h5py\_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
File "h5py\_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
File "h5py\h5d.pyx", line 87, in h5py.h5d.create
ValueError: Unable to create dataset (name already exists)