Solved by ptrblck in post #2 
              
              
                You have a recursion in your code, as you are overriding PyTorch’s load_state_dict method and are calling it inside via: 
model.load_state_dict(tr.load(PATH))

which will call the method again with the state_dict instead of the PATH. 
Rename your method to my_load_state_dict or any other name and it…