Open atekgul opened 4 months ago
Hi, thanks for the issue, yes, the utils
code is deprecated and going to be removed. I am planning to update example in favor to use PyTorch lightning. As for now you can refer to binary segmentation example.
P.S. utils is still accessible, but should be imported as
from segmentation_models_pytorch import utils
Thanks.
Hi. As I understand the below code in cars segmentation (camvid).ipynb should be changed. Because I can't run it. Am I right? Do you plan to update the examples?
There is no utils under smp.
TrainEpoch and ValidEpoch are not valid anymore.
Code: //Dice/F1 score - https://en.wikipedia.org/wiki/S%C3%B8rensen%E2%80%93Dice_coefficient //IoU/Jaccard score - https://en.wikipedia.org/wiki/Jaccard_index
loss = smp.utils.losses.DiceLoss() metrics = [smp.utils.metrics.IoU(threshold=0.5),] optimizer = torch.optim.Adam([dict(params=model.parameters(), lr=0.0001),])
//create epoch runners //it is a simple loop of iterating over dataloader`s samples train_epoch = smp.utils.train.TrainEpoch(model, loss=loss, metrics=metrics, optimizer=optimizer, device=DEVICE, verbose=True,)
valid_epoch = smp.utils.train.ValidEpoch(model, loss=loss, metrics=metrics, device=DEVICE, verbose=True,)