This repository has been archived by the owner on Jul 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Python3 compatibility #2
Comments
Thank you! Yes, please do. The chr assumption may also be in a few other places - e.g. text_encoder.py. Appreciate the help. We're on 2.7 at Google so Python 3 usage isn't as well-exercised/tested. |
Thanks for the info this is helpful |
See PR #22 |
PR #22 merged. Thanks! |
lukaszkaiser
pushed a commit
that referenced
this issue
Jun 29, 2017
RichardWen
referenced
this issue
in GnatLlib/tensor2tensor
Mar 11, 2018
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
There are some holes in the Python 3 compatibility of the Tensor2tensor code. For instance:
In data_generators/generator_utils.py,
import urllib
needs to be:In data_generators/image.py,
import cPickle
needs to be:Finally, data_generators/tokenizer.py needs to be revised as it assumes that a char ordinal is always in the range (0, 256), which is not a safe assumption in Python 3. A better solution uses a set instead of array subscripts based on char ordinals. Would you like me to submit a revised version in a pull request?
The text was updated successfully, but these errors were encountered: