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

example not working #74

Open
sp00ck opened this issue Apr 18, 2018 · 3 comments
Open

example not working #74

sp00ck opened this issue Apr 18, 2018 · 3 comments

Comments

@sp00ck
Copy link

sp00ck commented Apr 18, 2018

 python train.py
Traceback (most recent call last):
  File "train.py", line 11, in <module>
    from model import Model
  File "/home/user/word-rnn-tensorflow/model.py", line 3, in <module>
    from tensorflow.contrib import legacy_seq2seq
ImportError: cannot import name legacy_seq2seq

i have tensorflow ok

@Wrench-wench
Copy link

Wrench-wench commented Aug 25, 2020

I've had a similar issue with train.py calling tensorflow.contrib

Solved by running python -m pip install tensorflow==1.14 from inside the python venv I was using.

Ubuntu 18.04 LTS
Tensorflow 1.14
Python 3.6.9

Hope this helps with your issue.

@sp00ck
Copy link
Author

sp00ck commented Aug 25, 2020

Defaulting to user installation because normal site-packages is not writeable
ERROR: Could not find a version that satisfies the requirement tensorflow==1.14 (from versions: 2.2.0rc1, 2.2.0rc2, 2.2.0rc3, 2.2.0rc4, 2.2.0, 2.3.0rc0, 2.3.0rc1, 2.3.0rc2, 2.3.0)
ERROR: No matching distribution found for tensorflow==1.14

$uname -a
Linux 5.7.12-200.fc32.x86_64 #1 SMP Sat Aug 1 16:13:38 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

@Wrench-wench
Copy link

Wrench-wench commented Aug 26, 2020

Interesting. The only way I could replicate the error message is by misspelling the package name, but by your reply I can see it was spelt correctly.

I installed a fresh copy of Ubuntu 18.04 on a machine and setup Word-RNN-Tensorflow.
Here are all the commands I used to set it up in a Python venv, hopefully one of these are your fix.

# Update the OS software and grab some Python packages. 
sudo apt update && sudo apt upgrade -y
sudo apt install python3-dev python3-pip python3-venv git

# Make a directory and start a Python virtual environment in it
mkdir projectfolder 
python3 -m venv --system-site-packages projectfolder/
source projectfolder/bin/activate

# Move in to the folder, get the needed Python modules and clone the git 
cd projectfolder/
pip install --upgrade pip setuptools tensorflow==1.14
git clone https://github.com/hunkim/word-rnn-tensorflow.git

# Start Word-RNN using the provided example set
cd word-rnn-tensorflow
python train.py

Good luck!

EDIT: Forgot about markdown, changed formatting.

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

2 participants