The 'module' object does not have the attribute 'feature_column'

I ran the official tutorial from Google ( \ " main \", fname, loader, pkg_name) \ n File \ "/ usr / lib / python 2.7 / runpy.py \", line 72, in _run_code \ n exec code in the run_globals file \ n \ "/root/.local/lib/python2.7/site-packages/trainer/task.py \", line 4, in the \ 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: Object 'module' does not have attribute 'feature_column' \ n "

// UPDATE

Nothing. I understood. It turns out that the --runtime-version argument controls the version of Runtime Cloud ML (). In the tutorial, it was listed as 1.0, and this 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, June 29, 2017. I donโ€™t know if they saw my post, but this was changed from June 28 to June 29. Future users in this tutorial should not experience the same problem as me.

+5
source share
2 answers

This can also happen when updating the Google Cloud SDK, in which case pip install --upgrade tensorflow should complete the task.

+2
source

I ran into this problem with an outdated version of tensor flow. Updating it to the latest build helped.

+1
source

Source: https://habr.com/ru/post/1269309/


All Articles