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

TypeError: cannot serialize '_io.BufferedReader' object #25

Open
TSMLuL opened this issue Apr 2, 2019 · 1 comment
Open

TypeError: cannot serialize '_io.BufferedReader' object #25

TSMLuL opened this issue Apr 2, 2019 · 1 comment

Comments

@TSMLuL
Copy link

TSMLuL commented Apr 2, 2019

Hi!

I am currently trying to execute the WaveNet_demo.ipynb file which you kindly provided for download.

When executing the trainer.train(batch_size=16, epochs=10) part, I unfortunately run into an error message like this TypeError: cannot serialize '_io.BufferedReader' object (full error message below).

Do you know why this could be or how to fix it? I did not find any related threads on the internet unfortuately...

I am on a windows 10 machine, python 3.7.3, torch version 1.0.1.

Cheers and thanks a lot

Full error message:

Traceback (most recent call last): File "C:/Users/Benedict/PycharmProjects/pytorch-wavenet/SCRIPTtest.py", line 80, in <module> trainer.train(batch_size=16, epochs=1) File "C:\Users\Benedict\PycharmProjects\pytorch-wavenet\wavenet_training.py", line 64, in train for (x, target) in iter(self.dataloader): File "C:\Users\Benedict\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\utils\data\dataloader.py", line 819, in __iter__ return _DataLoaderIter(self) File "C:\Users\Benedict\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\utils\data\dataloader.py", line 560, in __init__ w.start() File "C:\Users\Benedict\AppData\Local\Programs\Python\Python37\lib\multiprocessing\process.py", line 112, in start self._popen = self._Popen(self) File "C:\Users\Benedict\AppData\Local\Programs\Python\Python37\lib\multiprocessing\context.py", line 223, in _Popen return _default_context.get_context().Process._Popen(process_obj) File "C:\Users\Benedict\AppData\Local\Programs\Python\Python37\lib\multiprocessing\context.py", line 322, in _Popen return Popen(process_obj) File "C:\Users\Benedict\AppData\Local\Programs\Python\Python37\lib\multiprocessing\popen_spawn_win32.py", line 89, in __init__ reduction.dump(process_obj, to_child) File "C:\Users\Benedict\AppData\Local\Programs\Python\Python37\lib\multiprocessing\reduction.py", line 60, in dump ForkingPickler(file, protocol).dump(obj) TypeError: cannot serialize '_io.BufferedReader' object

@thinking-tower
Copy link

thinking-tower commented May 12, 2019

@TSMLuL I'm also working through this repo!

I've found the issue (but don't know why it's an issue). In WavenetTrainer.train(), do this:
dataloader = torch.utils.data.DataLoader(self.dataset, batch_size=32, shuffle=True, #num_workers=4, pin_memory=False)

I don't know how to do new lines in code but anyways main point is comment out the num_workers line. (Sauce)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants