lancopku/Skeleton-Based-Generation-Model

enhancement - upgrade to support 1.8 tensorflow

Closed this issue · 4 comments

this maybe beyond scope of project - but would be nice to get this working with updated tensorflow.

currently breaks on TypeError: '>' not supported between instances of 'int' and 'Flag'

max_size of vocab was specified as 20000; we now have 20000 words. Stopping reading.
Finished constructing vocabulary of 20000 total words. Last word added: richie
Traceback (most recent call last):
File "run_summarization.py", line 653, in
tf.app.run()
File "/Users/jpope/miniconda2/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 126, in run
_sys.exit(main(argv))
File "run_summarization.py", line 488, in main
sc_batcher = Sc_GenBatcher(vocab, hps_sc_generator)
File "/Users/jpope/Documents/tensorflowWorkspace/Skeleton-Based-Generation-Model/sc_batch.py", line 249, in init
self.train_queue = self.fill_example_queue("data/trainfeature02.json")
File "/Users/jpope/Documents/tensorflowWorkspace/Skeleton-Based-Generation-Model/sc_batch.py", line 472, in fill_example_queue
example = Sc_Example(text, label, pos_tagging, compression, dependency, self._vocab, self._hps)
File "/Users/jpope/Documents/tensorflowWorkspace/Skeleton-Based-Generation-Model/sc_batch.py", line 44, in init
if len(text_sen_words) > hps.sc_max_enc_seq_len:
TypeError: '>' not supported between instances of 'int' and 'Flag'

Since tensorflow is updated too frequently, some interfaces in our code may not work on your version. We will update our code to support the latest tensorflow version. The latest code will be released soon. Thanks for your suggestion!

There are three lines with the same content in summarization.py should be modified like this :
"hps_dict[key] = val --> hps_dict[key] = val.value"
That should work! @johndpope

I trained open ai gpt2 on terminator 2 script got it to spit out this

https://gist.github.com/johndpope/9a6a813efa58adc674ff191c934625f6

You can use google cloud to train on your own story
https://colab.research.google.com/drive/1_FR6rY52YVMh710oM9MC3LCW1g3o3YHv#scrollTo=8DKMc0fiej4N

@jingjingxupku Hey I tried those code today and it still has the same problem. Is the updated version here yet?
Thanks