githubharald / CTCWordBeamSearch

Connectionist Temporal Classification (CTC) decoder with dictionary and language model.
https://towardsdatascience.com/b051d28f3d2e
MIT License
557 stars 160 forks source link

The Session graph is empty. Add operations to the graph before calling run(). #54

Closed ivaylojelev closed 3 years ago

ivaylojelev commented 3 years ago

Dear sir,

Thank you for this project. When I try to run the test python code it gives me the following error:

Traceback (most recent call last): File "testCustomOpv2.py", line 91, in testMiniExample() File "testCustomOpv2.py", line 65, in testMiniExample res = testCustomOp(mat, corpus, chars, wordChars) File "testCustomOpv2.py", line 15, in testCustomOp sess.run(tf.compat.v1.global_variables_initializer()) File "/home/ivaylo/.local/lib/python3.8/site-packages/tensorflow/python/client/session.py", line 967, in run result = self._run(None, fetches, feed_dict, options_ptr, File "/home/ivaylo/.local/lib/python3.8/site-packages/tensorflow/python/client/session.py", line 1116, in _run raise RuntimeError('The Session graph is empty. Add operations to the ' RuntimeError: The Session graph is empty. Add operations to the graph before calling run().

It might be worthy to note that I used tf_upgrade_v2 to upgrade to TF 2.0 as this version is no longer supported.

ivaylojelev commented 3 years ago

Nevermind, I just needed to disable eager execution