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

AttributeError: 'module' object has no attribute 'in_graph_mode' #17

Open
johnnyrevell opened this issue Jul 10, 2018 · 2 comments
Open

Comments

@johnnyrevell
Copy link

Any idea about this error? I get it when running python demo.py
18.04 Ubuntu running stock Python 2.7.15rc1
Have installed:
apt install python-tk
pip install numpy svgwrite matplotlib scipy tensorflow pandas sklearn

Full error:
Traceback (most recent call last): File "demo.py", line 153, in <module> hand = Hand() File "demo.py", line 37, in __init__ attention_mixture_components=10 File "/home/john/handwriting-synthesis/rnn.py", line 85, in __init__ super(rnn, self).__init__(**kwargs) File "/home/john/handwriting-synthesis/tf_base_model.py", line 108, in __init__ self.graph = self.build_graph() File "/home/john/handwriting-synthesis/tf_base_model.py", line 399, in build_graph self.loss = self.calculate_loss() File "/home/john/handwriting-synthesis/rnn.py", line 204, in calculate_loss lambda: self.sample(cell) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/util/deprecation.py", line 432, in new_func return func(*args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/control_flow_ops.py", line 2063, in cond orig_res_t, res_t = context_t.BuildCondBranch(true_fn) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/control_flow_ops.py", line 1913, in BuildCondBranch original_result = fn() File "/home/john/handwriting-synthesis/rnn.py", line 203, in <lambda> lambda: self.primed_sample(cell), File "/home/john/handwriting-synthesis/rnn.py", line 162, in primed_sample scope='rnn' File "/home/john/handwriting-synthesis/rnn_ops.py", line 246, in rnn_free_run states, outputs, final_state = raw_rnn(cell, loop_fn, scope=scope) File "/home/john/handwriting-synthesis/rnn_ops.py", line 40, in raw_rnn if context.in_graph_mode(): AttributeError: 'module' object has no attribute 'in_graph_mode'

@ssell
Copy link

ssell commented Oct 18, 2018

I had the same issue and udnaan's commit fixed it for me.

System:

  • Windows 10 1803
  • Python 3.6.2
  • TensorFlow 1.11.0

@samvatsar
Copy link

samvatsar commented Mar 31, 2020

I had the same issue and udnaan's commit fixed it for me.

System:

  • Windows 10 1803
  • Python 3.6.2
  • TensorFlow 1.11.0

Hi @ssell , please let me know how did u solve the issue.
I was getting the error: #22. but, when i removed the lines 9, 29 and 30 as suggested by you, i am getting the 'in_graph_mode' error. Kindly help me.

I got it! ChenXiaoTemp's pull request has the solution.

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

3 participants