a-PyTorch-Tutorial-to-Image-Captioning
a-PyTorch-Tutorial-to-Image-Captioning copied to clipboard
TypeError: h5py objects cannot be pickled
hi, I am trying to run train.py, I get an error as "TypeError: h5py objects cannot be pickled". I think the error is stemming from torch.utils.data.DataLoader. or did i miss any configurations? i have no idea about how to tackle it.
the error stack trace is as follow.
Traceback (most recent call last):
File "D:/study/workspace/Python/a-PyTorch-Tutorial-to-Image-Captioning/train.py", line 333, in
Process finished with exit code 1
hello,I face the same problems with you? how can i handle this problems?
@liuyyy111 @Christine620 It happens because h5py won't read from multiple processes. By omitting num_workers, you're setting it to the default of 0, which uses only the main process. You could also set it to 1 (on Linux, at least). So try to set :
num_workers=0. it works for me.