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

Most upvoted comments

@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