I get the data from torchvision.datasets.MNIST.
Then, I try to save the path and labels in a txt named mnist_test.txt,but here is an error

que1.png958×881 32.6 KB

i try to change the type of img,but it doesn’t work.
Thanks for your help !