czbiohub-sf/noise2self

Problem with Intro to Neural Nets notebook, line next(enumerate

Closed this issue · 3 comments

Hi, I am having a problen when running the "Intro to Neural Nets" notebook, in the line:

i, test_batch = next(enumerate(test_data_loader))

the jupiter notebook gets stuck and doesn't show any error, even when I try to run the code in spyer. I find it strange because the notebook says "This notebook runs on a MacBook Pro in under one minute."

Any help?

Thanks in advance

Just happen to be passing by and noticed this issue. Is it possible that it's actually downloading the dataset at that point? I think that's the first instance in the notebook when the testing data is used. Maybe you could check to see if you have a spike in network activity at that point–if so, it shouldn't happen again after the data is cached.

Thank you for your comment jamestwebber!

Actually the dataset is downloaded in a previous line, almost at the beginning of the code:
mnist_test = MNIST('../data/MNIST', download = True, transform = transforms.Compose([ transforms.ToTensor(), ]), train = False)

I was checking the line where I had problem and finally when I changed the previous line:
test_data_loader = DataLoader(noisy_mnist_test, batch_size=32, shuffle=False, num_workers=3)

With this:
test_data_loader = DataLoader(noisy_mnist_test, batch_size=32, shuffle=False)

This change solved the problem, although I'm not sure why...

Just seeing this now. I'm also not sure what the num_workers problem is, though I'm glad your problem was resolved by deleting it! Let me know if you ran into further issues.