sherjilozair / char-rnn-tensorflow

Multi-layer Recurrent Neural Networks (LSTM, RNN) for character-level language models in Python using Tensorflow
MIT License
2.64k stars 960 forks source link

ImportError: cannot import name legacy_seq2seq #87

Closed BSVogler closed 7 years ago

BSVogler commented 7 years ago

Hi!

I just downloaded the code and tried to run it with the train.py with tf-v1.0. I think it should train the Shakespeare example. Readme says default parameters. However it fails

Traceback (most recent call last):
  File "train.py", line 11, in <module>
    from model import Model
  File "/opt/gpu-project/char-rnn-tensorflow/model.py", line 3, in <module>
    from tensorflow.contrib import legacy_seq2seq
ImportError: cannot import name legacy_seq2seq
BSVogler commented 7 years ago

Hmm, my fault. I ran it with python and not with python3.

hugovk commented 7 years ago

This should work with Python 2.7, just make sure you have Tensorflow 1.0 (and not, say, the latest Tensorflow 1.2).

pip install tensorflow==1.0