Copy a model by deep copy does not work

I am trying following line:
best_model=copy.deepcopy(model)

and getting following error:

TypeError: can't pickle torch._C.ScriptFunction objects

Is this happening for some version changes or something because this code worked before?