Understanding metrics and callbacks

Maybe someone can help me here: I simply can’t get the f_scores to work with my own data, no matter whether images or other. It works fine in the planets notebook, but even if I copy the exact same stuff over, I always get “mismatch” complaints, that I don’t understand. Training works fine, lr find works fine, metrics like accuracy and/or Precision() get displayed nicely, but as soon as I add any fbeta based metric, it stops working:

this is the specific code right now:

f1_fai = partial(fbeta, thresh=0.2)
#f2_fai = partial(fbeta, beta=2)
learn = tabular_learner(data, layers=[512, 512, 512, 256, ], metrics=[accuracy, f1_fai])
learn.fit_one_cycle(2, 1e-2, wd=0.01)

Error that follows:

And I don’t understand the numbers. bs=8, classes=2, training-examples are table rows with 512 columns. Where does the number 12 even come from??

I am running on fastai v1.0.28

1 Like