Skip to content
Discussion options

You must be logged in to vote

Welp, I guess I solved it, thanks to Google and Github.
I don't understand why/how that fixed the problem.

SOLUTION:

# add this import
from joblib.externals.loky.backend.context import get_context

BATCH_SIZE = 32
CPU_COUNT = os.cpu_count()    # this now can be > 0

# add multiprocessing_context in DataLoader
train_dataloader = DataLoader(
    dataset=train_data,
    batch_size=BATCH_SIZE,
    shuffle=True,
    num_workers=CPU_COUNT,
    multiprocessing_context=get_context('loky') # ADD THIS LINE
)

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@mrdbourke
Comment options

@prinkeeras
Comment options

Answer selected by mrdbourke
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants