chrisdonahue / wavegan

WaveGAN: Learn to synthesize raw audio with generative adversarial networks
MIT License
1.33k stars 280 forks source link

print() is a function in Python 3 #2

Closed cclauss closed 6 years ago

cclauss commented 6 years ago

flake8 testing of https://github.com/chrisdonahue/wavegan on Python 3.6.3

$ flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics

./backup.py:19:40: E999 SyntaxError: invalid syntax
    print 'Waiting for first checkpoint'
                                       ^
./train_specgan.py:112:11: E999 SyntaxError: invalid syntax
  print '-' * 80
          ^
./train_wavegan.py:39:11: E999 SyntaxError: invalid syntax
  print '-' * 80
          ^
./data/count_tfrecord.py:40:9: E999 SyntaxError: invalid syntax
  print n
        ^
./data/preview_tfrecord.py:50:13: E999 SyntaxError: invalid syntax
    print '-' * 80
            ^
./data/ljspeech/split.py:36:15: E999 SyntaxError: invalid syntax
      print '-' * 80
              ^
./data/sc09/split.py:26:15: E999 SyntaxError: invalid syntax
      print '-' * 80
              ^
./eval/inception/score.py:147:35: E999 SyntaxError: invalid syntax
  print 'Inception score: {} +- {}'.format(mean, std)
                                  ^
./eval/inception/train.py:168:27: E999 SyntaxError: invalid syntax
        print 'Preview: {}'.format(latest_ckpt_fp)
                          ^
./eval/noise/noise.py:56:18: E999 SyntaxError: invalid syntax
  print '{} +- {}'.format(np.mean(X_weighted_mean), np.std(X_weighted_mean))
                 ^
./eval/similarity/sim.py:14:24: E999 SyntaxError: invalid syntax
  print 'Creating model'
                       ^
./web/bundle.py:19:16: E999 SyntaxError: invalid syntax
  print '{}->{}'.format(path, out_path)
               ^
12    E999 SyntaxError: invalid syntax
12
chrisdonahue commented 6 years ago

Thx for raising this issue. I will work on Py3 compatibility soon. I think it should be a small change.

kolemikko commented 6 years ago

I already updated my Wavegan files to work with Python 3.x, quite small change after all. I can share them if it helps!

cclauss commented 6 years ago

Please share them.

kolemikko commented 6 years ago

Should I send them to you @chrisdonahue ? So you could check the code and push the changes for everyone.

LiangqunLu commented 6 years ago

I noticed the print error from python2 in my python3 environment. Then I tried these 2 lines and it works fine now. 2to3 -W train_wavegan.py #change python2 to python3 automatically autopep8 -i train_wavegan.py #fix the tab issues

cclauss commented 6 years ago

@LiangqunLu See #6