Skip to content

How to add model metrics like accuracy, recall, precision etc. of segmentation task #1013

Answered by adamjstewart
Raji-Ahmad asked this question in Q&A
Discussion options

You must be logged in to vote

You'll want to read https://pytorch-lightning.readthedocs.io/en/stable/extensions/logging.html to understand how to combine TorchMetrics and PyTorch Lightning for logging within TorchGeo.

There are actually a few questions here:

How can I print ...

Currently, only loss is displayed on the command line. To add other metrics to the progress bar, you'll need to add prog_bar=True to all self.log(...) and self.log_dict(...) calls in torchgeo/trainers/segmentation.py. However, you'll notice that the progress bar is rather short and you probably won't have enough room to see all metrics printed unless you have an ultrawide monitor. A better solution would be to use a logger like CSVLogger or T…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Raji-Ahmad
Comment options

Answer selected by adamjstewart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants