Skip to content

TripletDataset #1061

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

Closed
wants to merge 21 commits into from
Closed

TripletDataset #1061

wants to merge 21 commits into from

Conversation

dakshjotwani
Copy link
Contributor

This pull request implements the TripletDataset discussed in #1042. @fmassa @ssnl I look forward to both of you reviewing my work. Please let me know if any additional changes need to be made.

@dakshjotwani
Copy link
Contributor Author

Also, the travis-ci build is failing because it cannot import IterableDataset. I had to build pytorch from source to be able to import it. How would I go about fixing that?

@dakshjotwani
Copy link
Contributor Author

Turns out that my testcases won't pass even after removing IterableDataset since the test case checks the __iter__ method, and the __iter__ method uses get_worker_info, which also does not exist in the pip build. All other test cases are passing. Reverting commit.

This reverts commit d440290.

Add IterableDataset back to triplet.py
Copy link
Member

@fmassa fmassa left a comment

Choose a reason for hiding this comment

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

Thanks for the PR, I have a few comments.

Also, you can test your changes in CI with latest torchvision by changing the .travis.yaml file.

I don't think you should inherit from FolderDataset, because it's a Dataset, and not an IterableDataset and I'm unsure about the interactions it might have there.

Let me know what you think

@dakshjotwani
Copy link
Contributor Author

@fmassa @ssnl I have made the requested changes.

In .travis.yml, I changed pytorch to pytorch-nightly to inherit from IterableDataset. By doing this, however, test_cpp_models.py fails (none of my changes are run in this testcase). All tests relevant to my changes pass successfully. How should I go about this?

@fmassa
Copy link
Member

fmassa commented Jun 28, 2019

@dakshjotwani I'd need to check wrt the test_cpp_models failure, it might be a breaking change in core PyTorch that makes it not compatible.

cc @ShahriarSS if we update the PyTorch version to use the nightly, test_cpp_models seems to fail. Can you have a look?

@ShahriarRezghi
Copy link
Contributor

@fmassa please provide a link where it's failing and I'll look into it.

@dakshjotwani
Copy link
Contributor Author

@ShahriarSS https://travis-ci.org/pytorch/vision/builds/551800130 is this the link you're looking for?

@ShahriarRezghi
Copy link
Contributor

@dakshjotwani Yes. Thanks

@fmassa fmassa mentioned this pull request Jul 1, 2019
Copy link
Member

@fmassa fmassa left a comment

Choose a reason for hiding this comment

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

After some more thoughts, and after seeing @rwightman comment in #1042 (comment), I think we should make this class future-proof for when we want to add hard-negative mining to it.

Let's iterate on the API for it.

Thoughts?

@fmassa
Copy link
Member

fmassa commented Jul 2, 2019

From the discussion in #1042 (comment), let's hold on merging this until you get some results of performing the online within-batch triplet loss.

@ShahriarRezghi
Copy link
Contributor

@fmassa Apparently the failure of tests are because of a bug here. However I do have a temporary fix for now. Should I wait or apply the fix?

@fmassa
Copy link
Member

fmassa commented Jul 3, 2019

@ShahriarSS this is then something that should disappear once PyTorch gets fixed, is that right?

@ShahriarRezghi
Copy link
Contributor

@fmassa I would think so. Here is the mention of the problem.

@dakshjotwani
Copy link
Contributor Author

Closing this for now, since we don't plan on adding a TripletDataset anytime soon.

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

Successfully merging this pull request may close these issues.

4 participants