apex: local variable 'count_all' referenced before assignment error
I am using apex installed from the latest commit (1ff54b8fed441c39dac181091b44fecdca31a403) of the master branch.
I am getting an error: local variable 'count_all' referenced before assignment
from https://github.com/NVIDIA/apex/blob/master/apex/parallel/optimized_sync_batchnorm_kernel.py#L63 when running my model in evaluation mode
I think during evaluation mode, track_running_stats
will be set to False which causes count_all
not to be initialized since count_all
is initialized under if track_running_stats
block
About this issue
- Original URL
- State: open
- Created 4 years ago
- Reactions: 8
- Comments: 15
Commits related to this issue
- Fix Issue #913 Fix the error: "local variable 'count_all' referenced before assignment" during evaluation mode. — committed to JinwooWang/apex by JinwooWang 3 years ago
- Merge pull request #1 from JinwooWang/master Fix Issue https://github.com/NVIDIA/apex/issues/913 — committed to minostauros/apex by minostauros 3 years ago
- Merge pull request #1 from JinwooWang/master Fix Issue #913 — committed to Pedrexus/apex by Pedrexus 3 years ago
@Alec-Lin I think you are right, I use BN 1d in my network too. I solved the problem by reseting it back to previous version, before commit 1ff54b8
Same issue for the latest version