Skip to content

batch out of range & loss value becomes 'nan' when running monocular depth estimation #1832

@Gacha76

Description

@Gacha76

Issue Type

Bug

Source

source

Keras Version

Keras 2.10

Custom Code

No

OS Platform and Distribution

Windows 11

Python version

3.10.13

GPU model and memory

RTX 3050 6GB

Current Behavior?

When calling the .fit() function to train the model, the 1st epoch runs as expected and stops when all batches have been iterated.

The problem starts from the 2nd epoch onwards where batches start running out of the given range and loss values become nan. Once the epoch is complete, the UI becomes normal again but this behavior is observed again for the 3rd epoch and so on.

Screenshot 2024-04-13 111550

All tutorials on Youtube running the same Colab notebook given by the Keras Team seem to run without having any issues and the model trains properly but this isn't the case when I run the notebook locally or on Colab using both CPU and GPU.

Standalone code to reproduce the issue or tutorial link

https://colab.research.google.com/github/keras-team/keras-io/blob/master/examples/vision/ipynb/depth_estimation.ipynb

Relevant log output

No response

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions