Skip to content Skip to sidebar Skip to footer

Python - Attributeerror: 'dict' Object Has No Attribute 'train'

I have this error: AttributeError: 'dict' object has no attribute 'train' in my code below : def main(unused_argv): # Load training and eval data image_ind = 10 svhn = sio.loadmat(

Solution 1:

I don't see anything wrong... scipy.io.loadmat returns a dictionary, and base dictionaries don't have a "train" attribute. If there is a "train" variable in the matlab file, then it will be stored as dictionary key, so you can access it as svhn['train'] (as opposed to svhn.train).


Post a Comment for "Python - Attributeerror: 'dict' Object Has No Attribute 'train'"