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

why not from PIL import Image #101

Closed
crcrpar opened this issue Feb 12, 2018 · 5 comments
Closed

why not from PIL import Image #101

crcrpar opened this issue Feb 12, 2018 · 5 comments
Assignees

Comments

@crcrpar
Copy link

crcrpar commented Feb 12, 2018

I wonder why not from PIL import Image in https://github.com/bethgelab/foolbox/blob/master/foolbox/utils.py#L76-L78

In major open sources, they use from PIL import Image such as pillow official documents and pytorch/torchvision.
In addition to this, I encountered an error when using foolbox.utils.imagenet_example caused by PIL.Image.open.

@jonasrauber
Copy link
Member

jonasrauber commented Feb 16, 2018

Can you clarify what you mean. Whether I do import PIL and then use PIL.Image or instead from PIL import Image and then use Image shouldn't make a difference?!

@crcrpar
Copy link
Author

crcrpar commented Feb 17, 2018

In my environment, PIL.Image raised AttributeError: module 'PIL' has no attribute 'Image'.
This error is solved by using from PIL import Image instead.

my environment:

  • python 3.5.3
  • Pillow 5.0.0

@jonasrauber jonasrauber self-assigned this Feb 17, 2018
@jonasrauber
Copy link
Member

Interesting. Thanks for reporting this. If you want you can make a pull-request, otherwise I will fix it in a few days.

jonasrauber pushed a commit to jonasrauber/foolbox that referenced this issue Feb 19, 2018
@jonasrauber
Copy link
Member

fixed in the recently released version 0.12.4

@crcrpar
Copy link
Author

crcrpar commented Feb 19, 2018

Thank you.

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