LantaoYu / SeqGAN

Implementation of Sequence Generative Adversarial Nets with Policy Gradient
2.08k stars 711 forks source link

Support python3.5.2? #22

Closed wangtao1321 closed 7 years ago

wangtao1321 commented 7 years ago

Hi, Would you have idea to support python3.5.2 environment?as Tensorflow for windows only support python3.5.2

josaum commented 7 years ago

Hi @wangtao1321 , I just made it work on Py3.5 and windows.

1 - Run the command: 2to3 -w -f all sequence_gan.py 2 - Run the command: 2to3 -w -f all generator.py 3 - Change Line 92 in sequence_gan.py to: target_params = pickle.load(open('save/target_params_py3.pkl', 'rb'))

Note that the picke file changed to the suitable py3 version and also add the 'rb' to read the raw binary and don't get overridden by the OS default encoding.

That should make it work, at least it did for me.

Hope it helps!