When I use the fit_one_cycle to train the model, it outputs “train loss, val loss, metric”, I want to know where is the metric caculated on? Trainset or valset?

Another question I want to ask is about:
learn = create_cnn(data, models.resnet18, metrics=accuracy, callback_fns=BnFreeze)
Dose BnFreeze only freeze the BN layer which requires_grad==False, If we set train_bn = True, dose BN layer be freezed?

The metrics are always computed on the validation set in fastai.
For your second question it freezes the layer if it doesn’t require_grad (require_grads=False), and leave it untouched otherwise.

when are they on trainset, generally speaking?