Open Zardinality opened 7 years ago
Thanks. We use python 2.7 for the development. I will update README for this. If possible, maybe you can write all your workaround for python3 here. I think it will be helpful for the others. We really appreciate it.
Also there's another issue when try to retrain the network in Python 3. When you try to load a pickle object that was originally created in Python 2.x, it is most likely to trigger a UnicodeDecodeError
:
UnicodeDecodeError: 'ascii' codec can't decode byte 0x89 in position 1: ordinal not in range(128)
The solution can be found here: GitHub: Unpickling a Python 2 object with Python 3
@hanzhanggit Can you update this in readme.md? Thanks!
I notice there is no requirement about python version in readme. But actually besides common import of
print
andabsolute import
fromfuture
, there are still some issues need to be resolved when I try to run the demo in python3. Including: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?
Some string format problem, like
caption
indrawCaption
and the pattern insave_super_images
.dict.iteritem
,dict.haskey
method has been deprecated in python3, insteaddict.items
andin
are used. So some code inconfig.py
need to be modified.the result
torchfile.load
returns doesn't support access values through fetching attribute, likeeasydict
. So I use[]
( e.g.t_file[b'raw_txt']
) to access values, for a workaround.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).xrange
, inpreprocess_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.