Skip to content

Image Classification From Scratch: Make note of large batch size #1949

@jxu

Description

@jxu

Issue Type

Documentation Bug

Source

binary

Keras Version

3.6.0

Custom Code

No

OS Platform and Distribution

Ubuntu 22.04

Python version

3.10

GPU model and memory

Quadro M1200 4 GB

Current Behavior?

Running the example I kept getting OOM trying to allocate 10 GB. Then I remembered my old GPU only has 4 GB memory. Changing batch-size from 128 to 32 fixed it. That might sound obvious, but I after spending half a day trying to install CUDA, I almost gave up and thought it was unsolvable when I encountered the error.

Anyone running a slightly older GPU like the RTX 2080 8 GB will probably get OOM too.

Standalone code to reproduce the issue or tutorial link

https://keras.io/examples/vision/image_classification_from_scratch/

Original error: RESOURCE_EXHAUSTED: Out of memory while trying to allocate 1078460416 bytes.

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