Problem with data types


(Szymon Bielenica) #1

Hello,

I have a problem with data types. My model is densenet169 for image classification in Histopathologic Cancer Detection Kaggle competition. I can’t use default accuracy metrics due to an error.

When I modify accuracy function problem with data type is gone but then my accuracy is always 0.5 :confused:

Screenshot%20from%202019-01-11%2017-54-51

What’s wrong? Just let me know if I should provide more info.


#2

Are you sure your data has been properly interpreted by the fastai library? From this error it looks like it believes you are in a multi-class problem. Could you give us the code on how you create your DataBunch?


(Szymon Bielenica) #3

I didn’t even connect this error with categories!
Now when I look closer at data info I realize that it shouldn’t be multi category! My fault.

Code:

Edit:

It’s working now! Thank you @sgugger for your help. After your suggestion that there’s something wrong with data, I checked it and found small error: label_from_df(sep=','). Now I realize it’s from df not csv. I overlooked it.

I still don’t understand why this separator made my data multi-class. And how did you found this clue in my error?


#4

Be careful with sep, it’s meant to be used for multi-class problem only, so you shouldn’t pass it.