kentonl / e2e-coref

End-to-end Neural Coreference Resolution
Apache License 2.0
518 stars 174 forks source link

Error while executing demo.py #82

Open chanchalIITP opened 4 years ago

chanchalIITP commented 4 years ago

Hi. I have already downloaded all the required files. Execution of demo.py gives model based error(checkpoint issue). I am attaching the error trace. Please help. thank you in advance.

File "demo.py", line 47, in model.restore(session) File "/Data/chanchal_1821cs11/e2e-coref-master_fresh/coref_model.py", line 94, in restore saver.restore(session, checkpoint_path) File "/Data/chanchal_1821cs11/anaconda3/envs/coref_py2/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 1312, in restore err, "a mismatch between the current graph and the graph") tensorflow.python.framework.errors_impl.InvalidArgumentError: Restoring from checkpoint failed. This is most likely due to a mismatch between the current graph and the graph from the checkpoint. Please ensure that you have not altered the graph expected based on the checkpoint. Original error:

Assign requires shapes of both tensors to match. lhs shape= [1,8] rhs shape= [115,8] [[node save_2/Assign_4 (defined at /Data/chanchal_1821cs11/e2e-coref-master_fresh/coref_model.py:90) ]]

Caused by op u'save_2/Assign_4', defined at: File "demo.py", line 47, in model.restore(session) File "/Data/chanchal_1821cs11/e2e-coref-master_fresh/coref_model.py", line 90, in restore saver = tf.train.Saver(vars_to_restore) File "/Data/chanchal_1821cs11/anaconda3/envs/coref_py2/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 832, in init self.build() File "/Data/chanchal_1821cs11/anaconda3/envs/coref_py2/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 844, in build self._build(self._filename, build_save=True, build_restore=True) File "/Data/chanchal_1821cs11/anaconda3/envs/coref_py2/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 881, in _build build_save=build_save, build_restore=build_restore) File "/Data/chanchal_1821cs11/anaconda3/envs/coref_py2/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 513, in _build_internal restore_sequentially, reshape) File "/Data/chanchal_1821cs11/anaconda3/envs/coref_py2/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 354, in _AddRestoreOps assign_ops.append(saveable.restore(saveable_tensors, shapes)) File "/Data/chanchal_1821cs11/anaconda3/envs/coref_py2/lib/python2.7/site-packages/tensorflow/python/training/saving/saveable_object_util.py", line 73, in restore self.op.get_shape().is_fully_defined()) File "/Data/chanchal_1821cs11/anaconda3/envs/coref_py2/lib/python2.7/site-packages/tensorflow/python/ops/state_ops.py", line 223, in assign validate_shape=validate_shape) File "/Data/chanchal_1821cs11/anaconda3/envs/coref_py2/lib/python2.7/site-packages/tensorflow/python/ops/gen_state_ops.py", line 64, in assign use_locking=use_locking, name=name) File "/Data/chanchal_1821cs11/anaconda3/envs/coref_py2/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 788, in _apply_op_helper op_def=op_def) File "/Data/chanchal_1821cs11/anaconda3/envs/coref_py2/lib/python2.7/site-packages/tensorflow/python/util/deprecation.py", line 507, in new_func return func(*args, **kwargs) File "/Data/chanchal_1821cs11/anaconda3/envs/coref_py2/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 3300, in create_op op_def=op_def) File "/Data/chanchal_1821cs11/anaconda3/envs/coref_py2/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 1801, in init self._traceback = tf_stack.extract_stack()

InvalidArgumentError (see above for traceback): Restoring from checkpoint failed. This is most likely due to a mismatch between the current graph and the graph from the checkpoint. Please ensure that you have not altered the graph expected based on the checkpoint. Original error:

Assign requires shapes of both tensors to match. lhs shape= [1,8] rhs shape= [115,8] [[node save_2/Assign_4 (defined at /Data/chanchal_1821cs11/e2e-coref-master_fresh/coref_model.py:90) ]]

robinsingh1 commented 3 years ago

I am experiencing the same issue while trying to run the demo in Google Colab, @chanchalIITP - were you able to resolve this by any chance ?

ZhuoranLyu commented 3 years ago

same question

shon-otmazgin commented 3 years ago

this is related to FileNotFoundError: [Errno 2] No such file or directory: 'char_vocab.english.txt'

?

TannerSorensen commented 1 year ago

Here's an idea for anyone else who is having this error and stumbles across this issue: this may be due to not modifying the path in https://github.com/kentonl/e2e-coref/blob/9d1ee1972f6e34eb5d1dcbb1fd9b9efdf53fc298/setup_training.sh#L20