sjvasquez / handwriting-synthesis

Handwriting Synthesis with RNNs ✏️
4.27k stars 568 forks source link

'tensorflow.python.eager.context' has no attribute 'in_graph_mode' #13

Closed aarondfrancis closed 6 years ago

aarondfrancis commented 6 years ago

First of all, thanks for this amazing tool! It looks incredible. I'm having a little trouble getting it to run locally with Python3 on my Macbook, but that may because I'm not super familiar with python.

Here's the error when I run python3 demo.py

  File "/handwriting-synthesis/rnn_ops.py", line 246, in rnn_free_run
    states, outputs, final_state = raw_rnn(cell, loop_fn, scope=scope)
  File "/handwriting-synthesis/rnn_ops.py", line 40, in raw_rnn
    if context.in_graph_mode():
AttributeError: module 'tensorflow.python.eager.context' has no attribute 'in_graph_mode'

I found https://github.com/tensorflow/tensorflow/issues/14069 which suggested trying

pip install --upgrade --force-reinstall tf-nightly

but they're talking mostly about 1.3 and 1.4 there, while I see you have 1.6 in the requirements.txt.

Can you point me in the right direction?

sjvasquez commented 6 years ago

Try using tensorflow==1.6.0

aarondfrancis commented 6 years ago

That did it, thank you!

ProvanceMedia commented 10 months ago

Is there support for tensorflow==2? When I tried we got the following error:

ModuleNotFoundError: No module named 'tensorflow.contrib' root@handwriting-synthesis:~/handwriting/handwriting-synthesis# pip install tensorflow.contrib ERROR: Could not find a version that satisfies the requirement tensorflow.contrib (from versions: none) ERROR: No matching distribution found for tensorflow.contrib

The tensorflow.contrib module was a part of TensorFlow 1.x, but seems it has been removed in TensorFlow 2.x. ??

Amazing work by the way!