9
votes

I ran the official tutorial from Google (link here). It ran fine locally but I got stuck on the part where I need to train the network on the Google Cloud Platform. I ran the following code on my terminal:

JOB_NAME=census_single_1
OUTPUT_PATH=gs://$BUCKET_NAME/$JOB_NAME
gcloud ml-engine jobs submit training $JOB_NAME \
--job-dir $OUTPUT_PATH \
--runtime-version 1.0 \
--module-name trainer.task \
--package-path trainer/ \
--region $REGION \
-- \
--train-files $TRAIN_DATA \
--eval-files $EVAL_DATA \
--train-steps 1000 \
--verbosity DEBUG

And I got the following error message:

"Traceback (most recent call last):\n File \"/usr/lib/python2.7/runpy.py\", line 162, in _run_module_as_main\n
\"main\", fname, loader, pkg_name)\n File \"/usr/lib/python2.7/runpy.py\", line 72, in _run_code\n exec code in run_globals\n File \"/root/.local/lib/python2.7/site-packages/trainer/task.py\", line 4, in \n import model\n File \"/root/.local/lib/python2.7/site-packages/trainer/model.py\", line 40, in \n
tf.feature_column.categorical_column_with_vocabulary_list(\nAttributeError: 'module' object has no attribute 'feature_column'\n"

// UPDATE

Never mind. I figured it out. It turns out the --runtime-version argument controls the Cloud ML Runtime Version (link). In the tutorial it was specified as 1.0, and that corresponds to Tensorflow v 1.0.1, which does not have tf.feature_column.* because it was just introduced in Tensorflow v 1.2.0 on June 16, 2017

// UPDATE 2

The Google tutorial has been updated to use --runtime-version 1.2 instead of --runtime-version 1.0 as of today, Jun 29, 2017. I don't know if they saw my post but this was changed between Jun 28 and Jun 29. Future users on that tutorial shouldn't experience the same issue I had.

2
same pb here. Version should be added to TensorFlowtensor
if you are happy with my answer feel free to mark it as the accepted one.Gal_M

2 Answers

4
votes

This could also happen from updating Google Cloud SDK, in which case pip install --upgrade tensorflow should do the job.

1
votes

I faced this problem with an outdated version of tensorflow. Updating it to the latest build helped.