Skip to content

Fix bug in LSUN dataset for test split. #435

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

Merged
merged 1 commit into from
Apr 4, 2018
Merged

Fix bug in LSUN dataset for test split. #435

merged 1 commit into from
Apr 4, 2018

Conversation

iacolippo
Copy link
Contributor

Both conditional branches in __init__ were executed, since classes for test
becomes a list and if was used instead of elif.

Both conditional branches in `__init__` were executed, since `classes` for test
becomes a list and `if` was used instead of `elif`.
@@ -81,7 +81,7 @@ def __init__(self, db_path, classes='train',
classes = [classes]
else:
classes = [c + '_' + classes for c in categories]
if type(classes) == list:
elif type(classes) == list:

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

@fmassa fmassa merged commit c933729 into pytorch:master Apr 4, 2018
@fmassa
Copy link
Member

fmassa commented Apr 4, 2018

Thanks!
About changing it to isinstance, that is indeed more pythonic, but we would ideally also want to handle py2/py3 compatibility (using something like https://github.com/pytorch/pytorch/blob/master/torch/_six.py#L29-L32)

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.

3 participants