deep-anpr icon indicating copy to clipboard operation
deep-anpr copied to clipboard

Error running ./extractbgs.py SUN397.tar.gz

Open Maya1994 opened this issue 7 years ago • 11 comments

Hello, I'm getting this error while trying to execute ./extractbgs.py SUN397.tar.gz !

Traceback (most recent call last): File "./extractbgs.py", line 97, in extract_backgrounds(sys.argv[1]) File "./extractbgs.py", line 75, in extract_backgrounds im = im_from_file(f) File "./extractbgs.py", line 46, in im_from_file return cv2.imdecode(a, cv2.CV_LOAD_IMAGE_GRAYSCALE) AttributeError: 'module' object has no attribute 'CV_LOAD_IMAGE_GRAYSCALE'

can anyone help me please ! Thanks,

Maya1994 avatar Apr 10 '17 14:04 Maya1994

Change: return cv2.imdecode(a, cv2.CV_LOAD_IMAGE_GRAYSCALE) to: return cv2.imdecode(a, 0)

The former has been deprecated in the newer version of OpenCV! :)

rphly avatar Apr 11 '17 02:04 rphly

You can change also CV_LOAD_IMAGE_GRAYSCALE by IMREAD_GRAYSCALE on all yours files :-)

ghost avatar Apr 11 '17 07:04 ghost

thanks so much :D it works now

Maya1994 avatar Apr 11 '17 08:04 Maya1994

I'm trying now to run train.py :/ but i got this error !!! can u help me again ! i ' m beginner in python and deep learning !

File "./train.py", line 276, in initial_weights=initial_weights) File "./train.py", line 238, in train sess.run(init)

Maya1994 avatar Apr 11 '17 09:04 Maya1994

It's maybe that ? I don't really know but maybe so try it ! :-) https://github.com/matthewearl/deep-anpr/pull/23/files

ghost avatar Apr 11 '17 14:04 ghost

So ?

ghost avatar Apr 12 '17 07:04 ghost

thanks novsub for ur response , but it's not that i have already change the digits_loss and the presence_loss :/

Maya1994 avatar Apr 12 '17 08:04 Maya1994

I would like to ask you how to make extractbgs.py SUN397.tar.gz implementation

susancurry avatar Jul 26 '17 13:07 susancurry

File "./extractbgs.py", line 97, in extract_backgrounds(sys.argv[1])

This line of the error is to use what method to solve

susancurry avatar Jul 26 '17 13:07 susancurry

File "extractbgs.py", line 87 fname = "bgs/{:08d}.jpg".format(index) 這個bug要怎麼解決~~

susancurry avatar Aug 01 '17 05:08 susancurry

Hello sunsancurry, Simply run "extractbgs.py SUN397.tar.gz" under Command Prompt mode since my environment is Windows 10. It will extract several thousands of JPG files from it. I didn't encounter any bug while extracting those files.

cayman1021 avatar Jan 10 '18 07:01 cayman1021