0

I want to create a chatbot using Tensorflow.I am using the code in 'github.com/tensorflow/models/tree/master/tutorials/rnn/translate'.While running the code in google-cloud-ml-engine I am getting an exception '/usr/bin/python: No module named data_utils' and the job is getting failed. Here is the commands I used,

gcloud ml-engine jobs submit training ${JOB_NAME} \
  --package-path=. \
  --module-name=translate.translate \
  --staging-bucket="${TRAIN_BUCKET}" \
  --region=us-central1 \
  -- \
  --from_train_data=${INPUT_TRAIN_DATA_A} \
  --to_train_data=${INPUT_TRAIN_DATA_B} \
  --from_dev_data=${INPUT_TEST_DATA_A} \
  --to_dev_data=${INPUT_TEST_DATA_B} \
  --train_dir="${TRAIN_PATH}" \
  --data_dir="${TRAIN_PATH}" \
  --steps_per_checkpoint=5 \
  --from_vocab_size=45000 \
  --to_vocab_size=45000

ml_engine log screenshot 1

ml_engine log screenshot 2

Is it the problem with ml_engine or tensorflow?

I followed the blog 'blog.kovalevskyi.com/how-to-train-a-chatbot-with-the-tensorflow-and-google-cloud-ml-3a5617289032' and initially used 'github.com/b0noI/models/tree/translate_tutorial_supports_google_cloud_ml/tutorials/rnn/translate'. It was also giving the same error.

  • Possible duplicate of [ImportError: No module named data\_utils](https://stackoverflow.com/questions/41609678/importerror-no-module-named-data-utils) – amo-ej1 Jul 22 '17 at 05:49
  • Can you provide a recursive directory listing rooted at the directory that you run `gcloud` from? – rhaertel80 Jul 22 '17 at 21:17
  • @rhaertel80 [link] (http://boaloysius.me/sites/default/files/chat_bot_new.png). Here is a detailed screenshot. – boby aloysius johnson Jul 23 '17 at 05:26
  • Directory structure looks right. On further thought, I think you might need to import the file using "from translate import data_utils" – rhaertel80 Jul 23 '17 at 07:48
  • @rhaertel80 It is again failing with some other error. This is the GitHub link of the modified code (It is the packaged code after collected storage after running gcloud command). [Github Code](https://github.com/boaloysius/translate). [Error Screenshot](http://boaloysius.me/sites/default/files/chat_bot_1.png). I have modified __init__.py, translate.py and seq2seq_model.py files. – boby aloysius johnson Jul 23 '17 at 10:13
  • It means your code exited with non-zero exit code. I'm going to update the error message to be more clear, but even still, that probably doesn't help much. Can you try using gcloud ml-engine local train to (semi-) simulate the service? – rhaertel80 Jul 26 '17 at 02:46
  • @rhaertel80 I am getting [screenshot1](http://boaloysius.me/sites/default/files/Screen%20Shot1.png), [screehshot2](http://boaloysius.me/sites/default/files/Screen%20Shot2.png). I am following the [command](https://blog.kovalevskyi.com/how-to-train-a-chatbot-with-the-tensorflow-and-google-cloud-ml-3a5617289032#0cbf). I am running it from rnn folder – boby aloysius johnson Jul 26 '17 at 07:09
  • That error indicates the problem is in your construction of the graph. I'm not overly familiar with building RNNs in TF, but the error message does suggest that if you're using `tf.contrib.rnn.MultiRNNCell([single_cell] * num_layers)` to change it to `tf.contrib.rnn.MultiRNNCell([single_cell] for _ in range(num_layers))`. I don't know enough to fully understand the consequences or alternatives, but I'd start there since you are using the "old" syntax. – rhaertel80 Jul 26 '17 at 13:30

1 Answers1

0

None, it is actually a problem within the code you are uploading, namely satisfying local dependencies. The filedata_utils.py is located in the same folder as where you got the example from. This is also mentioned in this post you should make sure it is available for your model.

amo-ej1
  • 3,279
  • 26
  • 35