Im using hook in my code and after a few iterations i get this error:
File "/home/alireza/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 478, in __call__
    for hook in self._forward_hooks.values():
RuntimeError: OrderedDict mutated during iteration


does anyone know why?

image.png1067×424 105 KB