Deepcopy TypeError: can't pickle torch._C.Generator objects


I have a Policy class consisting of an lstm network and a cnn. During the training process I need to do a deepcopy. But when doing deepcopy(policy) I get the following error:

TypeError: can’t pickle torch._C.Generator objects

Couldnt find any helpful answer to this problem yet. Can anyone help?

1 Like

Have you solved this problem?
I face with the same problem.