google-research / uda

Unsupervised Data Augmentation (UDA)
https://arxiv.org/abs/1904.12848
Apache License 2.0
2.18k stars 312 forks source link

tensorflow-probability version for back translation #75

Open yusagi0603 opened 4 years ago

yusagi0603 commented 4 years ago

I have set up the environment that can run the training part perfectly, but when I wanted to try back translation on my data, it gave error like this: forward translation Traceback (most recent call last): File "/home/yuu/vir_env/tf-uda/bin/t2t-decoder", line 7, in from tensor2tensor.bin import t2t_decoder File "/home/yuu/vir_env/tf-uda/local/lib/python2.7/site-packages/tensor2tensor/bin/t2t_decoder.py", line 36, in from tensor2tensor.bin import t2t_trainer File "/home/yuu/vir_env/tf-uda/local/lib/python2.7/site-packages/tensor2tensor/bin/t2t_trainer.py", line 24, in from tensor2tensor import models # pylint: disable=unused-import File "/home/yuu/vir_env/tf-uda/local/lib/python2.7/site-packages/tensor2tensor/models/init.py", line 25, in from tensor2tensor.layers import modalities # pylint: disable=g-import-not-at-top File "/home/yuu/vir_env/tf-uda/local/lib/python2.7/site-packages/tensor2tensor/layers/modalities.py", line 28, in from tensor2tensor.layers import common_attention File "/home/yuu/vir_env/tf-uda/local/lib/python2.7/site-packages/tensor2tensor/layers/common_attention.py", line 31, in from tensor2tensor.layers import area_attention File "/home/yuu/vir_env/tf-uda/local/lib/python2.7/site-packages/tensor2tensor/layers/area_attention.py", line 23, in from tensor2tensor.layers import common_layers File "/home/yuu/vir_env/tf-uda/local/lib/python2.7/site-packages/tensor2tensor/layers/common_layers.py", line 30, in import tensorflow_probability as tfp File "/home/yuu/vir_env/tf-uda/local/lib/python2.7/site-packages/tensorflow_probability/init.py", line 68, in _ensure_tf_install() File "/home/yuu/vir_env/tf-uda/local/lib/python2.7/site-packages/tensorflow_probability/init.py", line 65, in _ensure_tf_install present=tf.version)) ImportError: This version of TensorFlow Probability requires TensorFlow version >= 1.15; Detected an installation of version 1.13.1. Please upgrade TensorFlow to proceed. backward translation

But if I upgrade to tf 1.15, it gave another error like this:

Traceback (most recent call last): File "/home/yuu/vir_env/tf-uda/bin/t2t-decoder", line 7, in from tensor2tensor.bin import t2t_decoder File "/home/yuu/vir_env/tf-uda/local/lib/python2.7/site-packages/tensor2tensor/bin/t2t_decoder.py", line 36, in from tensor2tensor.bin import t2t_trainer File "/home/yuu/vir_env/tf-uda/local/lib/python2.7/site-packages/tensor2tensor/bin/t2t_trainer.py", line 24, in from tensor2tensor import models # pylint: disable=unused-import File "/home/yuu/vir_env/tf-uda/local/lib/python2.7/site-packages/tensor2tensor/models/init.py", line 79, in from tensor2tensor.models.video import savp File "/home/yuu/vir_env/tf-uda/local/lib/python2.7/site-packages/tensor2tensor/models/video/savp.py", line 36, in gan_losses = tf.contrib.gan.losses.wargs File "/home/yuu/vir_env/tf-uda/local/lib/python2.7/site-packages/tensorflow_core/python/util/lazy_loader.py", line 63, in getattr return getattr(module, item) AttributeError: 'module' object has no attribute 'gan'

Can anyone helps? Thanks.

nikeshnaik commented 4 years ago

try pip install tensor2tensor==1.8.0

yusagi0603 commented 4 years ago

Thanks for the suggestion! I will give it a try recently.

2020年3月3日火曜日 Nikesh Naik notifications@github.com:

try pip install tensor2tensor==1.8.0

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/google-research/uda/issues/75?email_source=notifications&email_token=AIQFAK442QVBULIVR4ZX3WTRFTRBHA5CNFSM4KDGDLYKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOENTC6BQ#issuecomment-593899270, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIQFAK2JAO4ZWM4VO3FUSYDRFTRBHANCNFSM4KDGDLYA .

ahnjaewoo commented 3 years ago

I recently solved this problem with the following options. Try it!

tensorflow-gpu==1.13.2
tensor2tensor==1.13.4
tensorflow-probability==0.6.0
mesh-tensorflow==0.0.5