I've provided a minimal-ish working example to reproduce the bug. I don't want to use the 'fork' method for multiprocessing for various reasons: avoiding race conditions, deadlocks, and that CUDA isn't supported with this method.
Can't pickle local object 'batch_meta_collate.<locals>._collate_fn'
File "/Users/mattie/Projects/pytorch-meta/test.py", line 42, in <module>
for i, batch in enumerate(dataloader):
I believe the culprit is below. Functions defined within functions are not pickle-able, and pickling is the method used for transporting data between processes when 'spawn' is used. Would you happen to know the best way to rewrite the batch_meta_collate function to prevent this issue?
I've provided a minimal-ish working example to reproduce the bug. I don't want to use the 'fork' method for multiprocessing for various reasons: avoiding race conditions, deadlocks, and that CUDA isn't supported with this method.
I believe the culprit is below. Functions defined within functions are not pickle-able, and pickling is the method used for transporting data between processes when 'spawn' is used. Would you happen to know the best way to rewrite the batch_meta_collate function to prevent this issue?
https://github.com/tristandeleu/pytorch-meta/blob/794bf82348fbdc2b68b04f5de89c38017d54ba59/torchmeta/utils/data/dataloader.py#L11-L24