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

Finetuning Example #41

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open

Conversation

nateraw
Copy link
Contributor

@nateraw nateraw commented May 13, 2021

Motivation and Context

Adds:

  • an example for finetuning pretrained torchhub models
  • MiniKineticsDataModule from PyTorch Lightning Flash
  • UCF11DataModule, a tiny example dataset

Currently a little messy - will fix it up in draft PR and then open it up when I finish.

How Has This Been Tested

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have completed my CLA (see CONTRIBUTING)
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@facebook-github-bot
Copy link
Contributor

Hi @nateraw!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 13, 2021
@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

Copy link
Contributor

@tullie tullie left a comment

Choose a reason for hiding this comment

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

Looking forward to getting this tutorial in! Feel free to refactor the previous tutorial slightly to make this one better. E.g. might be worth making a data.py which contains the data module wrappers and common transform recipes.

tutorials/video_classification_example/train.py Outdated Show resolved Hide resolved
tutorials/video_classification_example/finetune.py Outdated Show resolved Hide resolved
tutorials/video_classification_example/finetune.py Outdated Show resolved Hide resolved
tutorials/video_classification_example/finetune.py Outdated Show resolved Hide resolved
tutorials/video_classification_example/finetune.py Outdated Show resolved Hide resolved
tutorials/video_classification_example/finetune.py Outdated Show resolved Hide resolved
tutorials/video_classification_example/finetune.py Outdated Show resolved Hide resolved
tutorials/video_classification_example/finetune.py Outdated Show resolved Hide resolved
tutorials/video_classification_example/finetune.py Outdated Show resolved Hide resolved
tutorials/video_classification_example/finetune.py Outdated Show resolved Hide resolved
facebook-github-bot pushed a commit that referenced this pull request May 18, 2021
Summary:
Add Gifs to Github readme.

Pull Request resolved: fairinternal/pytorchvideo#41

Reviewed By: haooooooqi

Differential Revision: D28494810

Pulled By: kalyanvasudev

fbshipit-source-id: 40c3ca6b3355bd249460b7e39336c3d39c53a3da
Copy link
Contributor

@tullie tullie left a comment

Choose a reason for hiding this comment

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

Looking better, please address rest of comments then i'm happy to accept! Thanks for addressing #32

tutorials/video_classification_example/data.py Outdated Show resolved Hide resolved
tutorials/video_classification_example/data.py Outdated Show resolved Hide resolved
tutorials/video_classification_example/data.py Outdated Show resolved Hide resolved
tutorials/video_classification_example/data.py Outdated Show resolved Hide resolved
tutorials/video_classification_example/data.py Outdated Show resolved Hide resolved
tutorials/video_classification_example/data.py Outdated Show resolved Hide resolved
tutorials/video_classification_example/train.py Outdated Show resolved Hide resolved
tutorials/video_classification_example/train.py Outdated Show resolved Hide resolved
tutorials/video_classification_example/train.py Outdated Show resolved Hide resolved
Copy link
Contributor

@tullie tullie left a comment

Choose a reason for hiding this comment

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

LGTM!

@tullie
Copy link
Contributor

tullie commented May 21, 2021

@kalyanvasudev can you do a quick pass over this before we merge it in?

@kalyanvasudev
Copy link
Contributor

@kalyanvasudev can you do a quick pass over this before we merge it in?

Sure, on it. Will add my comments by EOD.

@nateraw nateraw marked this pull request as ready for review May 22, 2021 01:22
@kalyanvasudev kalyanvasudev self-assigned this May 22, 2021
@nateraw
Copy link
Contributor Author

nateraw commented May 24, 2021

@kalyanvasudev I think we are all good here now - I removed the finetuning tutorial from the site for now + will open a separate PR for it when I finish (likely tomorrow or tuesday 😉 )

@facebook-github-bot
Copy link
Contributor

@kalyanvasudev has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

facebook-github-bot pushed a commit that referenced this pull request May 25, 2021
Summary:
## Motivation and Context

Closes #32 by adding lambda in the tutorial. Code changes to be made in #41 - this is just a quickfix.

## How Has This Been Tested

## Types of changes

- [x] Docs change / refactoring / dependency upgrade
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)

## Checklist

- [x] My code follows the code style of this project.
- [x] My change requires a change to the documentation.
- [x] I have updated the documentation accordingly.
- [x] I have read the **CONTRIBUTING** document.
- [x] I have completed my CLA (see **CONTRIBUTING**)
- [ ] I have added tests to cover my changes.
- [ ] All new and existing tests passed.

Pull Request resolved: #49

Reviewed By: tullie

Differential Revision: D28685418

Pulled By: kalyanvasudev

fbshipit-source-id: 0984c0433119be11c768d784e1c05d22ffec4729
@borijang
Copy link

borijang commented Aug 4, 2022

The finetune script requires command line arguments, can you specify what do we need to input?

@nateraw
Copy link
Contributor Author

nateraw commented Aug 9, 2022

Hey there @borijang - I'm not 100% sure this code still works since its so out of date, but the command line args that aren't specified directly with add_argument are coming directly from the datamodule. Mainly, the --root flag is probably one you'll want to update (but I don't remember since I haven't run this code directly in a while).

I have similar code here which I think still works that you may find easier to use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants