0

Both locally, and on the cloud (kaggle) the notebook dies (forgetting any imports or variables, stopping the execution of the cell) when trying to fit a Keras model. This issue is only present when the custom layer SingularityExtractor2D is present in the architecture.

You can find the notebook here: Github

The custom callback GateOfLearning has been tested many times, working perfectly every time with any model architecture. The notebook has been run on both the GPU and CPU, the problem persists.

Movsisyan
  • 31
  • 4
  • You may check if [this](https://stackoverflow.com/questions/59576397/python-kernel-dies-on-jupyter-notebook-with-tensorflow-2) & [this](https://stackoverflow.com/questions/44110799/kernel-died-restarting-whenever-training-a-model) SO threads help you. – Shubham Panchal Aug 21 '21 at 01:40

1 Answers1

0

When calling the tf.ones function, the shape must be (spatial_0, ..., spatialN-1, in_channels, out_channels) as opposed to the shape of the tensor that the layer gets when getting a call (batch_size, spatial_0, ..., spatial_N-1, channels)

Movsisyan
  • 31
  • 4