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 DALIClassificationLoader to not use deprecated arguments #4925

Merged
merged 16 commits into from
Dec 18, 2020

Conversation

gan3sh500
Copy link
Contributor

@gan3sh500 gan3sh500 commented Dec 1, 2020

What does this PR do?

Fixes #4918 issue due to DALI API change. Now uses LastBatchPolicy's FILL and DROP instead of passing fill_last_batch.

Before submitting

  • Was this discussed/approved via a Github issue? (no need for typos and docs improvements)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure your PR does only one thing, instead of bundling different changes together? Otherwise, we ask you to create a separate PR for every change.
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests?
  • Did you verify new and existing tests pass locally with your changes?
  • If you made a notable change (that affects users), did you update the CHANGELOG?

PR review

Anyone in the community is free to review the PR once the tests have passed.
Before you start reviewing make sure you have read Review guidelines. In short, see the following bullet-list:

  • Is this pull request ready for review? (if not, please submit in draft mode)
  • Check that all items from Before submitting are resolved
  • Make sure the title is self-explanatory and the description concisely explains the PR
  • Add labels and milestones (and optionally projects) to the PR so it can be classified; Bugfixes should be including in bug-fix release milestones (m.f.X) and features should be included in (m.X.b) releases.

Did you have fun?

Make sure you had fun coding 🙃

@pep8speaks
Copy link

pep8speaks commented Dec 1, 2020

Hello @gan3sh500! Thanks for updating this PR.

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2020-12-18 13:31:30 UTC

@Borda Borda added 3rd party Related to a 3rd-party example bug Something isn't working labels Dec 1, 2020
@Borda Borda added this to the 1.1 milestone Dec 1, 2020

def __len__(self):
batch_count = self._size // (self._num_gpus * self.batch_size)
last_batch = 1 if self._fill_last_batch else 0
last_batch = 0 if self._last_batch_policy == LastBatchPolicy.DROP else 1
Copy link
Member

Choose a reason for hiding this comment

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

will this work also with older DALI versions, if not can we add a simple switch to something for dali.__version__ > 0.28 and the old code for <=0.27

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No it will not. I will add some check based on Dali version like you said.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've pushed change for this. Tests passed except one which cancelled on its own.

@Borda Borda added the priority: 1 Medium priority task label Dec 1, 2020
@codecov
Copy link

codecov bot commented Dec 2, 2020

Codecov Report

Merging #4925 (d8c66e2) into master (81070be) will not change coverage.
The diff coverage is n/a.

@@          Coverage Diff           @@
##           master   #4925   +/-   ##
======================================
  Coverage      93%     93%           
======================================
  Files         134     134           
  Lines        9928    9928           
======================================
  Hits         9242    9242           
  Misses        686     686           

@tchaton
Copy link
Contributor

tchaton commented Dec 3, 2020

Hey @gan3sh500 @Borda , ready for review ?

@gan3sh500
Copy link
Contributor Author

@tchaton It is ready. I was waiting for @Borda to confirm.

@Borda
Copy link
Member

Borda commented Dec 3, 2020

@tchaton It is ready. I was waiting for @Borda to confirm.

I made just small update =)

@edenlightning edenlightning modified the milestones: 1.1, 1.1.x Dec 8, 2020
@Borda Borda added ready PRs ready to be merged and removed ready PRs ready to be merged labels Dec 8, 2020
@Borda Borda self-assigned this Dec 8, 2020
@gan3sh500
Copy link
Contributor Author

@Borda can I try out some other issue or is there more I should do here?

@Borda
Copy link
Member

Borda commented Dec 9, 2020

@Borda can I try out some other issue or is there more I should do here?

Sure, ping me on slack, we can find good one for you...

@mergify mergify bot requested a review from a team December 12, 2020 14:57
@Borda Borda added the ready PRs ready to be merged label Dec 16, 2020
@Borda Borda merged commit 16e819e into Lightning-AI:master Dec 18, 2020
awaelchli pushed a commit that referenced this pull request Dec 18, 2020
* update DALIClassificationLoader to not use deprecated arguments

* fix line length

* dali version check added and changed args accordingly

* versions

* checking version using disutils.version.LooseVersion now

* .

* ver

* import

Co-authored-by: Jirka Borovec <jirka.borovec@seznam.cz>
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
Borda added a commit that referenced this pull request Dec 23, 2020
* update DALIClassificationLoader to not use deprecated arguments

* fix line length

* dali version check added and changed args accordingly

* versions

* checking version using disutils.version.LooseVersion now

* .

* ver

* import

Co-authored-by: Jirka Borovec <jirka.borovec@seznam.cz>
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
Borda added a commit that referenced this pull request Dec 29, 2020
* update DALIClassificationLoader to not use deprecated arguments

* fix line length

* dali version check added and changed args accordingly

* versions

* checking version using disutils.version.LooseVersion now

* .

* ver

* import

Co-authored-by: Jirka Borovec <jirka.borovec@seznam.cz>
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
Borda added a commit that referenced this pull request Jan 4, 2021
* update DALIClassificationLoader to not use deprecated arguments

* fix line length

* dali version check added and changed args accordingly

* versions

* checking version using disutils.version.LooseVersion now

* .

* ver

* import

Co-authored-by: Jirka Borovec <jirka.borovec@seznam.cz>
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
Borda added a commit that referenced this pull request Jan 4, 2021
* update DALIClassificationLoader to not use deprecated arguments

* fix line length

* dali version check added and changed args accordingly

* versions

* checking version using disutils.version.LooseVersion now

* .

* ver

* import

Co-authored-by: Jirka Borovec <jirka.borovec@seznam.cz>
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
Borda added a commit that referenced this pull request Jan 5, 2021
* update DALIClassificationLoader to not use deprecated arguments

* fix line length

* dali version check added and changed args accordingly

* versions

* checking version using disutils.version.LooseVersion now

* .

* ver

* import

Co-authored-by: Jirka Borovec <jirka.borovec@seznam.cz>
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3rd party Related to a 3rd-party bug Something isn't working example priority: 1 Medium priority task ready PRs ready to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fix DALI example
7 participants