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

ImportError: cannot import name SimpleSeq2seq #14

Closed
SeekPoint opened this issue Oct 14, 2016 · 1 comment
Closed

ImportError: cannot import name SimpleSeq2seq #14

SeekPoint opened this issue Oct 14, 2016 · 1 comment

Comments

@SeekPoint
Copy link

andy1028@andy1028-Envy:/media/andy1028/data1t/os_prj/github/debug_seq2seq$ python bin/train.py
INFO:gensim.utils:Pattern library is not installed, lemmatization won't be available.
INFO:summa.preprocessing.cleaner:'pattern' package not found; tag filters are not available for English
Using TensorFlow backend.
I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcublas.so locally
I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcudnn.so locally
I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcufft.so locally
I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcuda.so.1 locally
I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcurand.so locally
Traceback (most recent call last):
File "bin/train.py", line 10, in
from lib.nn_model.model import get_nn_model
File "/media/andy1028/data1t/os_prj/github/debug_seq2seq/lib/nn_model/model.py", line 4, in
from seq2seq.models import SimpleSeq2seq
ImportError: cannot import name SimpleSeq2seq

I had the done:

andy1028@andy1028-Envy:/media/andy1028/data1t/os_prj/github/debug_seq2seq/seq2seq$ git remote -v
origin https://github.com/farizrahman4u/seq2seq.git (fetch)
origin https://github.com/farizrahman4u/seq2seq.git (push)
andy1028@andy1028-Envy:/media/andy1028/data1t/os_prj/github/debug_seq2seq/seq2seq$ sudo python3 setup.py install
running install
running bdist_egg
running egg_info
writing seq2seq.egg-info/PKG-INFO
writing requirements to seq2seq.egg-info/requires.txt
writing dependency_links to seq2seq.egg-info/dependency_links.txt
writing top-level names to seq2seq.egg-info/top_level.txt
reading manifest file 'seq2seq.egg-info/SOURCES.txt'
writing manifest file 'seq2seq.egg-info/SOURCES.txt'
.....

@SeekPoint
Copy link
Author

it fixed by change

andy1028@andy1028-Envy:/media/andy1028/data1t/os_prj/github/debug_seq2seq$ git diff
diff --git a/lib/nn_model/model.py b/lib/nn_model/model.py
index 3f229a0..1f86c41 100644
--- a/lib/nn_model/model.py
+++ b/lib/nn_model/model.py
@@ -1,7 +1,7 @@
import os.path

from keras.models import Sequential
-from seq2seq.models import SimpleSeq2seq
+from seq2seq.models import SimpleSeq2Seq

from configs.config import TOKEN_REPRESENTATION_SIZE, HIDDEN_LAYER_DIMENSION, SAMPLES_BATCH_SIZE,
INPUT_SEQUENCE_LENGTH, ANSWER_MAX_TOKEN_LENGTH, NN_MODEL_PATH
@@ -20,7 +20,7 @@ def get_nn_model(token_dict_size):
_logger.info('Batch size: %s' % SAMPLES_BATCH_SIZE)

 model = Sequential()
  • seq2seq = SimpleSeq2seq(
  • seq2seq = SimpleSeq2Seq(
    input_dim=TOKEN_REPRESENTATION_SIZE,
    input_length=INPUT_SEQUENCE_LENGTH,
    hidden_dim=HIDDEN_LAYER_DIMENSION,
    andy1028@andy1028-Envy:/media/andy1028/data1t/os_prj/github/debug_seq2seq$

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

1 participant