bug描述
def get_fashion_mnist_labels(labels):
text_labels = ['t-shirt', 'trouser', 'pullover', 'dress', 'coat',
'sandal', 'shirt', 'sneaker', 'bag', 'ankle boot']
return [text_labels[int(i)] for i in labels]
TypeError Traceback (most recent call last)
in
----> 1 get_fashion_mnist_labels(8)
in get_fashion_mnist_labels(labels)
2 text_labels = ['t-shirt', 'trouser', 'pullover', 'dress', 'coat',
3 'sandal', 'shirt', 'sneaker', 'bag', 'ankle boot']
----> 4 return [text_labels[int(i)] for i in labels]
TypeError: 'int' object is not iterable
bug描述 def get_fashion_mnist_labels(labels): text_labels = ['t-shirt', 'trouser', 'pullover', 'dress', 'coat', 'sandal', 'shirt', 'sneaker', 'bag', 'ankle boot'] return [text_labels[int(i)] for i in labels]
TypeError Traceback (most recent call last)