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

issue while using flowers dataset #10298

Closed
putcn opened this issue Apr 30, 2018 · 2 comments · Fixed by #11204
Closed

issue while using flowers dataset #10298

putcn opened this issue Apr 30, 2018 · 2 comments · Fixed by #11204
Assignees

Comments

@putcn
Copy link
Contributor

putcn commented Apr 30, 2018

looks cv2 failed to import when trying to use flowers dataset in vgg16 test.
and the import error is ignored due to the following line in paddle/v2/image.py

try:
    import cv2
except ImportError:
    cv2 = None

the error message is as follows:

Exception in thread Thread-24:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/local/lib/python2.7/dist-packages/paddle/v2/reader/decorator.py", line 274, in handle_worker
    r = mapper(sample)
  File "/usr/local/lib/python2.7/dist-packages/paddle/v2/dataset/flowers.py", line 63, in default_mapper
    img = load_image_bytes(img)
  File "/usr/local/lib/python2.7/dist-packages/paddle/v2/image.py", line 131, in load_image_bytes
    img = cv2.imdecode(file_bytes, flag)
AttributeError: 'NoneType' object has no attribute 'imdecode'

currently the opencv dependency is resolved by

RUN pip install opencv-python

not sure if we need to change to/ add

RUN apt install -y python-opencv
@putcn putcn assigned putcn and luotao1 and unassigned putcn Apr 30, 2018
@luotao1
Copy link
Contributor

luotao1 commented Jun 5, 2018

I meet the same error.

@luotao1
Copy link
Contributor

luotao1 commented Jun 5, 2018

After I change to RUN apt install -y python-opencv, its OK now.

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 a pull request may close this issue.

2 participants