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

ImageClassifierData.from_paths cannot be called without transforms #163

Closed
radekosmulski opened this issue Feb 18, 2018 · 2 comments
Closed

Comments

@radekosmulski
Copy link
Contributor

download

This is raised because FilesDataset expects to be passed transform that responds to sz

class FilesDataset(BaseDataset):
    def __init__(self, fnames, transform, path):
        self.path,self.fnames = path,fnames
        super().__init__(transform)
    def get_n(self): return len(self.y)
    def get_sz(self): return self.transform.sz

I do not know what would be the correct way to fix this. Assuming images of varying sizes can live in referenced directories this gets tricky. I am also not sure if anything else uses this or if it is just a convenience method for the user.

(BTW I can train the model ok with just setting the body of get_sz to pass)

@kkbrandt
Copy link

kkbrandt commented Feb 22, 2018

I assume you've read the discussion about this at http://forums.fast.ai/t/fastai-dataset-imageclassifierdata-from-paths-without-transformations/9778 ?
This seems like a reasonable requirement to me, since the user will need to specify the size of the images they want.
What behavior would you expect from passing no transform?
This seems to cause quite a bit of confusion, so at the very least we should have parameter checking here to display a better error message

@radekosmulski
Copy link
Contributor Author

I was not aware of the conversation - thank you for pointing me to it.

On one hand I fully understand the argument for making the transforms necessary and this might be the way to go on this. Should clear some of the confusion (leaning towards this solution).

Wanted to say that on the other hand I am tempted by giving users the extra flexibility of just running images straight from a directory, but the more I think about it the less convinced I am that this is the way to go - especially as it might make the code unnecessarily complex.

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

No branches or pull requests

2 participants