lancopku / Unpaired-Sentiment-Translation

Code for "Unpaired Sentiment-to-Sentiment Translation: A Cycled Reinforcement Learning Approach" (ACL 2018)
109 stars 20 forks source link

Need Cuda-enabled GPU? In batcher_classification.py I am getting TypeError:unorderable types: int() > Flag() #5

Open J-Fo-S opened 5 years ago

J-Fo-S commented 5 years ago

Hi, Do I need to have a CUDA-enabled GPU to run this code? When I ignored that and tried executing the code, I received a TypeError:unorderable types: int() > Flag(). Not sure that this has anything to do with having a CUDA-enabled GPU, but I figured I'd mention it. The traceback is below - any advice on getting around this would be greatly appreciated. Seems like a very interesting approach and I'd really like to experiment with it.


  File "run_summarization.py", line 819, in <module>
    tf.app.run()
  File "/Users/jonathansherman/anaconda3/lib/python3.5/site-packages/tensorflow/python/platform/app.py", line 126, in run
    _sys.exit(main(argv))
  File "run_summarization.py", line 693, in main
    cla_batcher = ClaBatcher(hps_discriminator, vocab)
  File "/Users/jonathansherman/nlpir2018/final_project/Unpaired-Sentiment-Translation-master/batcher_classification.py", line 125, in __init__
    "train-original/*")
  File "/Users/jonathansherman/nlpir2018/final_project/Unpaired-Sentiment-Translation-master/batcher_classification.py", line 190, in fill_example_queue
    example = Example(review, score, self._vocab, self._hps)
  File "/Users/jonathansherman/nlpir2018/final_project/Unpaired-Sentiment-Translation-master/batcher_classification.py", line 43, in __init__
    if len(review_words) > hps.max_dec_steps: #:
TypeError: unorderable types: int() > Flag()```
vineetjohn commented 5 years ago

Not an author, but you're probably using a Tensorflow version greater than 1.4.1. Tensorflow 1.5 has breaking changes that are not reverse compatible.

The code in this repository is heavy coupled to the version 1.4.1. You'd have to downgrade to run this code.

J-Fo-S commented 5 years ago

Thank you much for the tip! I'll report back when I am able to try it in a few weeks