Multi-class vs Multi labels classification

Just wanted to share that if you get this error when you are doing multi-class classification:

AttributeError: 'bool' object has no attribute 'mean'

Perhaps you have the labels in ‘labels.csv’ with multiple worded label. fastai will regard it as multi-label classification (each separate word as one class, so there will some images with more than one label).

I tried the plant-seedlings-classification competition where they described some of the leaves like ‘common wheat’ with two words for a single label and I felt into this trap.

1 Like

you might need to index/encode the label

Omg that’s exactly a problem I had today.