One Question about 60-min blitz

Hello, I am a beginner of Pytorch. When I tried to execute codes in the 60-min blitz provided in the tutorial website, I found the error below:

/home/zephyr/anaconda3/bin/python3.6 /home/zephyr/PycharmProjects/prac1/
Files already downloaded and verified
Files already downloaded and verified
<torchvision.datasets.cifar.CIFAR10 object at 0x7f8027222cc0>

< object at 0x7f80272299e8>

deer ship car car
Exception ignored in: <bound method DataLoaderIter.del of < object at 0x7f80271bff28>>
Traceback (most recent call last):
File “/home/zephyr/anaconda3/lib/python3.6/site-packages/torch/utils/data/”, line 333, in del
File “/home/zephyr/anaconda3/lib/python3.6/site-packages/torch/utils/data/”, line 319, in _shutdown_workers
File “/home/zephyr/anaconda3/lib/python3.6/multiprocessing/”, line 337, in get
ImportError: sys.meta_path is None, Python is likely shutting down

Process finished with exit code 0

My code:

dataiter = iter(trainloader)
images, labels = next(dataiter)

show images


print labels

print(’ ‘.join(’%5s’ % classes[labels[j]] for j in range(4)))

So could anyone help me? Thanks very much!

I tried to run the code in terminal, and no errors occur, though no images showed…So the error mentioned above may be some unknown inappropriate configuration of Pycharm. Could anyone help me point out it? And I also want to know why the code in terminal does not show images.

Well,one self-answer again.The problem got solved. I closed the showed image, and the error occurs. If I don’t close the showed picture, the error won’t show any more. Thanks for visiting:slight_smile: .

I have this problem as well.

What do you mean by “closed the showed image”? No image ever showed up for me regardless of whether I run the .py file or copy&paste the lines into ipython.

Maybe you can try to run the code in the terminal, and see what happens; Or check if you copy and paste the complete code from the website, Or reinstall the Pytorch, and check if there is anything you missed before. If no image showed, it means your code really didn’t work out. These are all the things I have done before, I hope they may help you.

I have this problem as well. But I add the code “” after"imshow(torchvision.utils.make_grid(images))" by jupyter notebook, the photos are showed

I wanna know how did you close the showed image?