Hi,
I have an annoying issue that I can’t handle.
Some say that it is from batch size, others from the metric used for a non/binary segmentation, etc…
I tested different batch size, it is a binary segmentation, so I want to use IoU.
Quite lost, may you help me please ?
from catalyst.dl.callbacks import DiceCallback, IouCallback, \
CriterionCallback
runner.train(
model=model,
criterion=criterion,
optimizer=optimizer,
scheduler=scheduler,
# our dataloaders
loaders=loaders,
callbacks=[
# Each criterion is calculated separately.
CriterionCallback(
input_key="mask",
prefix="loss_iou",
criterion_key="iou"
),
# metrics
IouCallback(input_key="mask"),
],
# path to save logs
logdir=logdir,
num_epochs=num_epochs,
# save our best checkpoint by IoU metric
main_metric="iou",
# IoU needs to be maximized.
minimize_metric=False,
# for FP16. It uses the variable from the very first cell
fp16=fp16_params,
# for external monitoring tools, like Alchemy
monitoring_params=monitoring_params,
# prints train logs
verbose=True,
)