Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Compatibility issue for python3 #2

@Zardinality

Description

@Zardinality

I notice there is no requirement about python version in readme. But actually besides common import of print and absolute import from future, there are still some issues need to be resolved when I try to run the demo in python3. Including:

  1. I find relative path doesn't work wherever the directory I'm in. Is this alright in python2, or just because I use it in wrong way?

  2. Some string format problem, like caption in drawCaption and the pattern in save_super_images.

  3. dict.iteritem, dict.haskey method has been deprecated in python3, instead dict.items and in are used. So some code in config.py need to be modified.

  4. the result torchfile.load returns doesn't support access values through fetching attribute, like easydict. So I use [] ( e.g. t_file[b'raw_txt'] ) to access values, for a workaround.

  5. in drawCaption, fnt = ImageFont.truetype('Pillow/Tests/fonts/FreeMono.ttf', 50) is used, but I have no clue where the font is, and it doesn't work with any luck. So I use a font in /usr/share/fonts/(Linux).

  6. xrange, in preprocess_birds.py.

At last I run the demo successfully, with a lot of temporary workaround, but I would prefer a indication about python version in the README.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions