NVIDIA / NVIDIA/apex

ZeroDivisionError: float division by zero

Open
#889 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
9k
Forks
1.5k
Avg merge
2d 4h
Merged PRs (30d)
3

Description

I trained my model whith the loss decrease quickly. I encountered the "ZeroDivisionError: float division by zero" exception at the following place. I think it should somehow handle the case, though it is weird.

https://github.com/NVIDIA/apex/blob/b9e5d37dbdbfbf5596acce3b915acf4b1a93a789/apex/amp/scaler.py#L183

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at apex/amp/scaler.py line 183 and reproduce the ZeroDivisionError with the reported training condition. Trace the scaler calculation to determine the expected zero-loss behavior; done means the condition no longer raises unexpectedly and a regression check covers it.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.