bloomsburyai/question-generation

AttributeError: can't set attribute

Closed this issue · 5 comments

While trying to implement the code i ran into error when executing the train.sh, it shows an Attribute error as follow

$ bash train.sh
Run ID is  1539597253
Model type is  MALUUBA
Loaded SQuAD with  87599  triples
C:\Users\Akashtyagi\AppData\Local\Continuum\anaconda3\lib\site-packages\h5py\__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters
WARNING:tensorflow:From C:\Users\Akashtyagi\AppData\Local\Continuum\anaconda3\lib\site-packages\tensorflow\python\ops\rnn.py:417: calling reverse_sequence (from tensorflow.python.ops.array_ops) with seq_dim is deprecated and will be removed in a future version.
Instructions for updating:
seq_dim is deprecated, use seq_axis instead
WARNING:tensorflow:From C:\Users\Akashtyagi\AppData\Local\Continuum\anaconda3\lib\site-packages\tensorflow\python\util\deprecation.py:432: calling reverse_sequence (from tensorflow.python.ops.array_ops) with batch_dim is deprecated and will be removed in a future version.
Instructions for updating:
batch_dim is deprecated, use batch_axis instead
Traceback (most recent call last):
  File "./src/train.py", line 415, in <module>
    tf.app.run()
  File "C:\Users\Akashtyagi\AppData\Local\Continuum\anaconda3\lib\site-packages\tensorflow\python\platform\app.py", line 125, in run
    _sys.exit(main(argv))
  File "./src/train.py", line 135, in main
    model = MaluubaModel(vocab, training_mode=True, use_embedding_loss=FLAGS.embedding_loss)
  File "D:\Pythonn\blooms_QG\question-generation\src\maluuba_model.py", line 20, in __init__
    super().__init__(vocab, advanced_condition_encoding=True, training_mode=training_mode, use_embedding_loss=use_embedding_loss)
  File "D:\Pythonn\blooms_QG\question-generation\src\seq2seq_model.py", line 36, in __init__
    super().__init__()
  File "D:\Pythonn\blooms_QG\question-generation\src\base_model.py", line 14, in __init__
    self.build_model()
  File "D:\Pythonn\blooms_QG\question-generation\src\seq2seq_model.py", line 298, in build_model
    name="copy_layer")
  File "D:\Pythonn\blooms_QG\question-generation\src\copy_mechanism\copy_layer.py", line 136, in __init__
    self.output_mask=output_mask
AttributeError: can't set attribute

z

Hi, could you please detail what version of python and tensorflow you're using?

It was due to the Tesnsorflow version. Earlier i was using Tensorflow 1.10.0 on Python3.
Now i downgraded it to Tensorflow1.7.0 and that particular issue got resolved.

But now couldn't train the model due the following error !

screenshot from 2018-10-17 19-29-09

That normally happens when you run out of memory - try adding the --testing flag, which reduces the number of parameters and batch size. If that works, then RAM or lack of GPU is your limiting factor, and you'll need to train with a smaller model or smaller batch size.

Did you mean to add '--testing' flag in the command to terminal while running the script, because that didn't help !
Can you please help figure it out !

I am using the command - "

bash train.sh

Hi,

I can't help without knowing more about the system that you're attempting to run the model on. That error is being thrown because of some lower level system error, not because of the model - it normally happens when there's not sufficient memory to run the script. Have a look at this stackoverflow question for more details:
https://stackoverflow.com/questions/45735858/why-tensorflow-just-outputs-killed