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

Update PyTorch Lightning Flash integration #1671

Merged
merged 23 commits into from Apr 8, 2022
Merged

Conversation

ehofesmann
Copy link
Member

@ehofesmann ehofesmann commented Apr 6, 2022

Resolves #1482

This PR updates the integration with pytorch lightning flash to work with the updates from the past two versions that resulted in breaking changes for the previous implementation. The integration now works with flash versions >= 0.7.0.
Now, the tasks of classification, detection, segmentation, and embedding generation for images and classification for video work again. Additionally, the dataset.apply_model(flash_model) syntax can be used again.

There were various changes made in lightning flash, the most relevant being:

  • model.predict() no longer being supported, only trainer.predict(model, datamodule)
  • data transformations/preprocessing updates moving it from a data_pipeline stored in the model
  • Serializers being renamed to output and their parameters changed
  • Changes in now model parameters and transformation arguments are supplied to datamodule, trainers, and models
  • Removing pretrained models from examples

This PR also adds intensive tests copying all examples in our integration documentation to allow them to be tested more easily and regularly to track future chagnes.

@ehofesmann ehofesmann added bug Bug fixes enhancement Code enhancement labels Apr 6, 2022
@ehofesmann ehofesmann self-assigned this Apr 6, 2022
@ehofesmann ehofesmann requested a review from a team April 7, 2022 21:48
@ehofesmann ehofesmann added documentation Documentation work and removed enhancement Code enhancement labels Apr 7, 2022
@ehofesmann ehofesmann changed the title [WIP] Update PyTorch Lightning Flash integration Update PyTorch Lightning Flash integration Apr 7, 2022
@ehofesmann ehofesmann marked this pull request as ready for review April 7, 2022 21:50
Copy link
Contributor

@brimoor brimoor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lookin' good! Just left a few small suggestions for you

docs/source/integrations/lightning_flash.rst Outdated Show resolved Hide resolved
fiftyone/utils/flash.py Outdated Show resolved Hide resolved
fiftyone/utils/flash.py Show resolved Hide resolved
tests/intensive/lightning_flash_tests.py Show resolved Hide resolved
tests/intensive/lightning_flash_tests.py Show resolved Hide resolved
@ehofesmann ehofesmann requested a review from brimoor April 8, 2022 15:25
Copy link
Contributor

@brimoor brimoor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ehofesmann ehofesmann merged commit 1986f11 into develop Apr 8, 2022
@ehofesmann ehofesmann deleted the lightning-flash branch April 8, 2022 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug fixes documentation Documentation work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Lightning Flash integration doesn't work with current Flash version
2 participants