Giter Club home page Giter Club logo

multitasksimplification's People

Contributors

hanguo97 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

multitasksimplification's Issues

Can you please post the exact command with parameters to train the model?

Hi! I am trying to train a model using your code, however I am confused about which parameters to use. I am currently getting the error below:

raceback (most recent call last):
File "run.py", line 482, in
tf.app.run()
File "/home/ggarbace/.local/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 48, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "run.py", line 467, in main
FLAGS, hps = add_arguments()
File "run.py", line 204, in add_arguments
raise ValueError("names and train_data_dirs not match")
ValueError: names and train_data_dirs not match

Thanks, and I hope to hear from you.

training time

Hi,
Could you please provide the training time different mtl methods(soft/hard/dynamic etc)?

Unable to load pre-trained models

Hi, I'm unable to load the pre-trained models on Google Colab. I'm getting the following error:
ValueError: Can't load save_path when it is None.
The following code snippet was used:
with tf.Session() as sess:
saver = tf.train.import_meta_graph('My Drive/Colab Notebooks/Multi_Tasking/model-final.meta')
saver.restore(sess, tf.train.latest_checkpoint('My Drive/Colab Notebooks/Multi_Tasking/'))

pretrained models

What are the pretrained models trained on wikilarge, newsela or wikismall?

Model output

Hi,

Would it be possible to get the model output for all the datasets?

Thanks!

Sampling from pre-trained model

I use the command below to sample from the pre-trained model:

    python run.py --mode decode --decode_ckpt_file NewselaFinalMTL/model-final --decode_data_dir decode/test_file.src --decode_output_file output.txt --log_root logs --exp_name test --soft_sharing_coef 0.1 --vocab_path cnn-dailymail/finished_files/vocab --batch_size 32 --beam_size 5 --max_enc_steps 5 --max_dec_steps 5 --steps_per_eval 5 --lr 0.01

However, I get the following error:

Task Newsela is using SummarizationModel
Task SNLI is using SummarizationModel
Task PP is using SummarizationModel
Loading Decoding Data from MultitaskSimplification2/decode/test_file.src
max_size of vocab was specified as 50000; we now have 50000 words. Stopping reading.
Finished constructing vocabulary of 50000 total words. Last word added: 18:19
Exception in thread Thread-1:
Traceback (most recent call last):
File "/home/usr/anaconda2/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
File "/home/usr/anaconda2/lib/python2.7/threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "MultitaskSimplification/pointer_model/batcher.py", line 341, in fill_example_queue
(article, abstract) = input_gen.next()
File "MultitaskSimplification/pointer_model/batcher.py", line 423, in text_generator
e = example_generator.next() # e is a tf.Example
File "MultitaskSimplification/pointer_model/data.py", line 139, in example_generator
example_str = struct.unpack('%ds' % str_len, reader.read(str_len))[0]
MemoryError

Creating SummarizationModel Newsela Model
INFO:tensorflow:Building graph...
TODO: Using tf.where to replace tf.cond in next_cell_input
change sampled_tokens not include ?
INFO:tensorflow:Time to build graph: 2 seconds
2020-05-05 14:35:23.921164: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA
INFO:tensorflow:Restoring parameters from MultitaskSimplification/NewselaFinalMTL/model-final
Traceback (most recent call last):
File "run.py", line 482, in
tf.app.run()
File "/home/usr/anaconda2/lib/python2.7/site-packages/usr/python/platform/app.py", line 48, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "run.py", line 475, in main
setup_and_run_decoding(FLAGS, hps)
File "run.py", line 452, in setup_and_run_decoding
decoder.decode(ckpt_file=FLAGS.decode_ckpt_file)
File "MultitaskSimplification/pointer_model/decode.py", line 63, in decode
misc_utils.load_ckpt(self._saver, self._sess, self._ckpt_dir, ckpt_file)
File "MultitaskSimplification/utils/misc_utils.py", line 64, in load_ckpt
saver.restore(sess, ckpt_file)
File "/home/usr/anaconda2/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 1666, in restore
{self.saver_def.filename_tensor_name: save_path})
File "/home/usr/anaconda2/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 889, in run
run_metadata_ptr)
File "/home/usr/anaconda2/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1120, in _run
feed_dict_tensor, options, run_metadata)
File "/home/usr/anaconda2/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1317, in _do_run
options, run_metadata)
File "/home/usr/anaconda2/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1336, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Assign requires shapes of both tensors to match. lhs shape= [50000] rhs shape= [29131]
[[Node: save_1/Assign_11 = Assign[T=DT_FLOAT, _class=["loc:@Newsela_Attention/policy/rnn/logits_kernel/bias"], use_locking=true, validate_shape=true, _device="/job:localhost/replica:0/task:0/device:CPU:0"](Newsela_Attention/policy/rnn/logits_kernel/bias, save_1/RestoreV2_11)]]

Caused by op u'save_1/Assign_11', defined at:
File "run.py", line 482, in
tf.app.run()
File "/home/usr/anaconda2/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 48, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "run.py", line 475, in main
setup_and_run_decoding(FLAGS, hps)
File "run.py", line 449, in setup_and_run_decoding
decoder.build_graph(decode_sess)
File "/srv/disk01/usr/TS/models/MultitaskSimplification/pointer_model/decode.py", line 57, in build_graph
self._saver = tf.train.Saver()
File "/home/usr/anaconda2/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 1218, in init
self.build()
File "/home/usr/anaconda2/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 1227, in build
self._build(self._filename, build_save=True, build_restore=True)
File "/home/usr/anaconda2/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 1263, in _build
build_save=build_save, build_restore=build_restore)
File "/home/usr/anaconda2/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 751, in _build_internal
restore_sequentially, reshape)
File "/home/usr/anaconda2/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 439, in _AddRestoreOps
assign_ops.append(saveable.restore(tensors, shapes))
File "/home/usr/anaconda2/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 160, in restore
self.op.get_shape().is_fully_defined())
File "/home/usr/anaconda2/lib/python2.7/site-packages/tensorflow/python/ops/state_ops.py", line 276, in assign
validate_shape=validate_shape)
File "/home/usr/anaconda2/lib/python2.7/site-packages/tensorflow/python/ops/gen_state_ops.py", line 57, in assign
use_locking=use_locking, name=name)
File "/home/usr/anaconda2/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper
op_def=op_def)
File "/home/usr/anaconda2/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2956, in create_op
op_def=op_def)
File "/home/usr/anaconda2/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 1470, in init
self._traceback = self._graph._extract_stack() # pylint: disable=protected-access

InvalidArgumentError (see above for traceback): Assign requires shapes of both tensors to match. lhs shape= [50000] rhs shape= [29131]
[[Node: save_1/Assign_11 = Assign[T=DT_FLOAT, _class=["loc:@Newsela_Attention/policy/rnn/logits_kernel/bias"], use_locking=true, validate_shape=true, _device="/job:localhost/replica:0/task:0/device:CPU:0"](Newsela_Attention/policy/rnn/logits_kernel/bias, save_1/RestoreV2_11)]]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.