Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while executing demo.py #82

Open
chanchalIITP opened this issue Dec 2, 2019 · 4 comments
Open

Error while executing demo.py #82

chanchalIITP opened this issue Dec 2, 2019 · 4 comments

Comments

@chanchalIITP
Copy link

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
Copy link

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
Copy link

same question

@shon-otmazgin
Copy link

shon-otmazgin commented Feb 28, 2021

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

?

@TannerSorensen
Copy link

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

ontonotes_path=/projects/WebWare6/ontonotes-release-5.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants