[Solved] RuntimeError: OrderedDict mutated during iteration – OrderedDict Could Not Changed
Problem
Today I tried to load the model weights file after torch.compile()
, and then I found the weights is stored by OrderedDict data structure. This data structure is an ordered sequence, in other word its content needs to follow the order.