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

genki.py error and background dataset question #4

Open
kingvision opened this issue Apr 10, 2015 · 3 comments
Open

genki.py error and background dataset question #4

kingvision opened this issue Apr 10, 2015 · 3 comments

Comments

@kingvision
Copy link

Hi
question one:
I run the genki.py , got the follow error:
python genki.py path/to/genki > trdata
Traceback (most recent call last):
File "genki.py", line 166, in
export(im, r, c, s)
File "genki.py", line 116, in export
write_rid(im)
File "genki.py", line 54, in write_rid
sys.stdout.buffer.write(hw)
AttributeError: 'file' object has no attribute 'buffer'

question two:
I can not download the background dataset using the following link:
https://googledrive.com/host/0Bw4IT5ZOzJj6NXlJUFh0UGZCWmc
can you give me another link?

@mrgloom
Copy link

mrgloom commented May 15, 2015

if you using python 2.7
replace
sys.stdout.buffer.write(hw)
to
sys.stdout.write(hw)

@mrgloom
Copy link

mrgloom commented May 23, 2015

Also if you are on windows, you must add folowing code:

if sys.platform == "win32":
    import os, msvcrt
    msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)

if sys.platform == "win64":
    import os, msvcrt
    msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)

http://stackoverflow.com/questions/2374427/python-2-x-write-binary-output-to-stdout

@kingvision
Copy link
Author

Thanks, i had fixed the error.

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