Reputation: 19
data_path = "/home/nikitha/Desktop/SOftmax/cifar-10-batches-bin/data_batch_1"
fo = open(data_path,'rb')
fo.seek(0)
fo.seek(0)
dict = (pickle.load(fo,encoding='bytes'))
l=np.array(dict[b'labels'])
d=np.array(dict[b'data'])
l=np.array(dict[b'labels'])
TypeError: 'type' object is not subscriptable
This is the above error I get when I run the code
Upvotes: 1
Views: 15988
Reputation: 102
In Python, dict is an object of type 'type'. You can't use it as a variable.
Upvotes: 1