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

AttributeError: 'module' object has no attribute 'CAP_PROP_FRAME_WIDTH' #2

Open
kenkroft opened this issue May 17, 2017 · 2 comments
Open

Comments

@kenkroft
Copy link

Hello,

First of all thanks for this amazing piece of code.

I got this problem though :

Traceback (most recent call last):
File "webcam-pix2pix.py", line 74, in
capture = init_capture(capture, output_shape=predictor.input_shape)
File "webcam-pix2pix.py", line 63, in init_capture
output_shape = output_shape
File "/home/corepan/Desktop/webcam-pix2pix-tensorflow-master/msa/capturer.py", line 31, in init
self.cvcap.set(cv2.CAP_PROP_FRAME_WIDTH, capture_shape[1])
AttributeError: 'module' object has no attribute 'CAP_PROP_FRAME_WIDTH'

Would you have an idea of what this could be ?

Thank so much.

@memo
Copy link
Owner

memo commented May 26, 2017

yes this usually happens when opencv can't find a camera. Do you have a webcam?

Alternatively, what version of opencv are you using?

@bjoernkarmann
Copy link

bjoernkarmann commented Sep 11, 2017

Hi memo, I have the same problem. I am using python2 and OpenCV 2. Any idea how fix it?

In my case, the GUI opens for 3 seconds and then it crashes with the same error as above:

AttributeError: 'module' object has no attribute 'CAP_PROP_FRAME_WIDTH'
Cleaned up camera.

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

3 participants