PyTorch Specific¶
Using num_workers > 0
for a DataLoader in Docker might causes issues ...
MULTIPROCESSING BEST PRACTICES
Runtime Error with DataLoader: exited unexpectedly #5301
https://forums.fast.ai/t/runtimeerror-dataloader-worker-pid-137-is-killed-by-signal-bus-error/27095
Hands on the Python module Multiprocessing
Comments¶
multiprocess is a fork of the Python standard libary multiprocessing . multiprocess extends multiprocessing to provide enhanced serialization, using dill. multiprocess leverages multiprocessing to support the spawning of processes using the API of the python standard library's threading module.
multiprocessing.Pool.map
does not work with lambda functions due to the fact that lambda functions cannot be pickled. There are multiple approaches to avoid the issue. You can define a function or usefunctools.partial