Se_di
(Se di)
November 28, 2020, 7:48pm
1
Hey,
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
Qi_Liu
(Qi Liu)
December 23, 2021, 2:37am
2
Have you solved this problem?
I face with the same problem.
acxz
(acxz)
July 5, 2022, 7:33pm
3
acxz
(acxz)
July 5, 2022, 7:34pm
4
If you post the entire definition of the class, maybe we can help out.
My guess is that you might have a self.torch_seed function call. Try to separate that call from the object you are pickling i.e. your Policy class.