Error in running .py with tensorflow and keras

Viewed 992

I have Keras 2.4.3 and TF 2.3.0 installed. I am using GPU for training my model. The training code is in ipynb format and py format. When I use Jupyter lab to run the code in ipynb format, it works. But when I use the terminal to run the same code in .py format, it pops out the following error:

line 146, in del TypeError: 'NoneType' object is not callable Exception ignored in: <function _CheckpointRestoreCoordinatorDeleter.del at 0x7fb593342160> Traceback (most recent call last):

There is no error when I run the code in ipynb format. The error only pops up when I use exactly the same code in py format and run it from the terminal.

1 Answers

You have not shared a code example, so we can only guess. The error indicates that the problem is related to restoring a checkpoint.

This can be alleviated using expect_partial(): For example:

`model.load_weights(path).expect_partial()`

or

`checkpoint.restore(path).expect_partial()`

See tensorflow/python/training/tracking/util.py.

Related