Skip to content

When pickling torch algorithms, move torch modules to CPU before pickling #2079

@avnishn

Description

@avnishn

Our current behavior is to pickle policies and value/q-functions so that they are pickled in their exact state, whether they are on gpu or not. This is bad because it forces users to use work-arounds to open torch pkled experiments on cpu only devices. A good example of this is when a user trains their policy on a server, but wants to see the policy in action, and they open it on their laptop, but their laptop doesn't have a gpu.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingpytorch

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions