Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trainers: predict step #813

Closed
6 tasks done
adamjstewart opened this issue Oct 4, 2022 · 6 comments · Fixed by #939
Closed
6 tasks done

Trainers: predict step #813

adamjstewart opened this issue Oct 4, 2022 · 6 comments · Fixed by #939
Assignees
Labels
trainers PyTorch Lightning trainers
Milestone

Comments

@adamjstewart
Copy link
Collaborator

adamjstewart commented Oct 4, 2022

Summary

This issue is to track progress on adding a predict step to all Trainers.

Rationale

The default predict step does not know how to handle our batch dicts.

Implementation

See implementations that have already been finished.

Alternatives

No response

Additional information

No response

@adamjstewart adamjstewart added this to the 0.3.2 milestone Oct 4, 2022
@isaaccorley
Copy link
Collaborator

BYOL could just return embeddings for each sample. RegressionTask should also be straightforward similar to ClassificationTask. I'll tackle these today. I think SemanticSegmentation may need some thought since it can be a large amount of data per sample and we don't want users to run OOM by accumulating masks for each sample.

@adamjstewart adamjstewart added the trainers PyTorch Lightning trainers label Oct 8, 2022
@Geethen
Copy link

Geethen commented Oct 16, 2022

If you have not already considered a similar option for the semantic segmentation regression task: https://rasterio.readthedocs.io/en/latest/topics/concurrency.html

uses rasterio + windows and concurrent to batch write data to a single large image.

@adamjstewart
Copy link
Collaborator Author

What's left to do for the SemanticSegmentationTask? Would like to finish this before the next release.

@isaaccorley
Copy link
Collaborator

isaaccorley commented Dec 6, 2022

Adding a predict step similar to the other tasks will just accumulate the segmentation output masks into a list. For large images and datasets this may not be desirable for memory usage reasons. We may want to consider saving the outputs somewhere instead or just leaving it to the user to override how they want the model to perform predictions.

@adamjstewart
Copy link
Collaborator Author

Could we go with a simpler implementation in which we return the predictions without saving? Or assume the user will want to predict on a small enough area that it can fit in memory? The current state where it crashes is unideal.

@isaaccorley
Copy link
Collaborator

isaaccorley commented Dec 7, 2022

Yes I'll make a PR for this. I'll add a note to the docstring for users to override by making a custom task if they want to do something specific with the masks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
trainers PyTorch Lightning trainers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants