You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PyTorch's Dataloader has an argument for num_workers which can fetch items from your dataset in parallel using multiprocessing, but this requires your dataset to be able to be pickled so Python can distribute it across multiple processes.
Currently, if you try to use multiple workers for a muspy dataset you get the following error:
AttributeError: Can't pickle local object 'Dataset.to_pytorch_dataset.<locals>.TorchRepresentationDataset'
I'm happy to open a PR with a fix for this, it mostly involves moving TorchRepresentationDataset and TorchMusicFactoryDataset to be defined outside of to_pytorch_dataset.
The text was updated successfully, but these errors were encountered:
PyTorch's Dataloader has an argument for
num_workers
which can fetch items from your dataset in parallel using multiprocessing, but this requires your dataset to be able to be pickled so Python can distribute it across multiple processes.Currently, if you try to use multiple workers for a
muspy
dataset you get the following error:There's more context on the
pickle
issue in this Stackoverflow thread.Here's a minimal reproducible example to test it out yourself:
I'm happy to open a PR with a fix for this, it mostly involves moving
TorchRepresentationDataset
andTorchMusicFactoryDataset
to be defined outside ofto_pytorch_dataset
.The text was updated successfully, but these errors were encountered: