Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jxu opened this issue Oct 5, 2024 · 0 comments
Open

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

jxu opened this issue Oct 5, 2024 · 0 comments
Assignees

Comments

@jxu
Copy link

jxu commented Oct 5, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants