I'm trying to run Tensorflow's translate.py from a python console rather than through bazel -build, but I get an error at these two lines:
from tensorflow.models.rnn.translate import data_utils
from tensorflow.models.rnn.translate import seq2seq_model
ImportError: No module named translate
I've checked the folder to see that the "init.py" file is there, but python seems to think there is no such module as translate. How can i fix this?
The best way to do this is to navigate to folder containing the translate module and running it. You can also download the translate module to any other place and run it. However, don't forget to change the above lines to:
from translate import data_utils
from translate import seq2seq_model
I resolved this issue by removing all the from tensorflow.models.rnn.translate
statements, leaving just
import data_utils
import seq2seq_model
in translate.py
and
import data_utils
in seq2seq_model.py
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With