with open('old_pickle.pkl', 'rb') as f:
old_net = pickle.load(f)
new_net = MyNetwork(*old_obj.init_args, **old_obj.init_kwargs)
misc.copy_params_and_buffers(old_net, new_net, require_all=True)
while doing this I'm getting error RuntimeError: a leaf Variable that requires grad is being used in an in-place operation.
According to me there is some in-place operation in the old_net.
How to modify old_net code to change the in-place operation?
with open('old_pickle.pkl', 'rb') as f: old_net = pickle.load(f) new_net = MyNetwork(*old_obj.init_args, **old_obj.init_kwargs) misc.copy_params_and_buffers(old_net, new_net, require_all=True)
while doing this I'm getting error RuntimeError: a leaf Variable that requires grad is being used in an in-place operation. According to me there is some in-place operation in the old_net. How to modify old_net code to change the in-place operation?