Your GPU might already be using device memory and loading the stored state_dict could cause the out of memory issue, so you might need to restart the notebook and load the state_dict at the beginning of it.