Home > other >  Keyerror: 'image' how to solve
Keyerror: 'image' how to solve

Time:02-25

Trainset_image=the sio. Loadmat (' D://GML MNIST data/trainset_image mat ')
Train_image=trainset_image [' image ']/255.0
Trainset_label=the sio. Loadmat (' D://GML MNIST data/trainset_label mat ')
Train_label=trainset_label [' label ']


Testset_image=the sio. Loadmat (' D://GML MNIST data/testset_image mat ')
Test_image=testset_image [' image ']/255.0
Testset_label=the sio. Loadmat (' D://GML MNIST data/testset_label mat ')
Test_label=testset_label [' label ']

Line -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Traceback (the most recent call last) :
The File "D://GML Pycharm project/number/mnist_train py", line 11, the in & lt; module>
Train_image=trainset_image [' image ']/255.0
KeyError: 'image'

CodePudding user response:

Print (trainset_image)

See if there are any image of this column,

CodePudding user response:

reference 1/f, old coconut response:
print (trainset_image)

See if there are any image of this column,

And after the code or the error

CodePudding user response:

Use the print (trainset_image) to confirm if there is a image of the column in the data,

See error message should be import trainset_image. Mat file, there is no image the column,

You cut below to see the print (trainset_image) output,

CodePudding user response:

Want to ask next subsequent building Lord... I'm stuck here
  • Related