Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Batch not serializable #66

Closed
4 of 8 tasks
duburcqa opened this issue May 30, 2020 · 0 comments · Fixed by #67
Closed
4 of 8 tasks

Batch not serializable #66

duburcqa opened this issue May 30, 2020 · 0 comments · Fixed by #67
Labels
bug Something isn't working

Comments

@duburcqa
Copy link
Collaborator

duburcqa commented May 30, 2020

  • I have marked all applicable categories:
    • exception-raising bug
    • RL algorithm bug
    • documentation request (i.e. "X is missing from the documentation.")
    • new feature request
  • I have visited the source website, and in particular read the known issues
  • I have searched through the issue tracker and issue categories for duplicates
  • I have mentioned version numbers, operating system and environment, where applicable

Batch instances are creating infinite recursive loop when used in argument of a multiprocessing Pipe. Here is a snippet to reproduce the issue.

from tianshou.data import Batch
from multiprocessing import Pipe
(p, c) = Pipe()
c.send(Batch(a=1.0))
print(p.recv())

Similarly, using Pickle without multiprocessing produces the same issue.

from tianshou.data import Batch
import pickle
pickle.dump(Batch(a=1.0), open("save.p", "wb"))                                                                                                                                                     
pickle.load(open("save.p", "rb"))

I'm going to open a PR that fixes the issue.

@duburcqa duburcqa changed the title Batch not supported by multiprocessing Pipe Batch not serializable May 30, 2020
@Trinkle23897 Trinkle23897 added the bug Something isn't working label Jun 1, 2020
@Trinkle23897 Trinkle23897 added this to TODO in Issue/PR Categories via automation Jun 1, 2020
@Trinkle23897 Trinkle23897 moved this from TODO to Bugs in Issue/PR Categories Jun 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

2 participants