GoogleCloudPlatform / GoogleCloudPlatform/training-data-analyst

Unusable lab due to deprecated TF 1.x code in "Using Neural Networks for Content-Based Filtering" (`content_based_using_neural_networks.ipynb`)

Open
#2,439 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
8.6k
Forks
6.1k
Avg merge
4h 44m
Merged PRs (30d)
2

Description

It was already a bad omen that the lab instructions (https://www.cloudskillsboost.google/course_sessions/2920313/labs/325069) tell me to pick a `TensorFlow Enterprise > TensorFlow Enterprise 1.15 (with LTS)` notebook. I could pick a 2.6 LTS.

The https://github.com/GoogleCloudPlatform/training-data-analyst/blob/master/courses/machine_learning/deepdive2/recommendation_systems/labs/content_based_preproc.ipynb was without a hickup, but then in the main notebook https://github.com/GoogleCloudPlatform/training-data-analyst/blob/master/courses/machine_learning/deepdive2/recommendation_systems/labs/content_based_using_neural_networks.ipynb I spotted `os.environ['TFVERSION'] = '1.15.3'` doubled down with `!pip3 install --upgrade tensorflow==1.15.3` and also other versions are ancient as well.

I had a Star Wars like "I have a bad feeling about this!" feeling, and then the training and eval step crashed and I started to tumble down the rabbit hole.

* `columns = tf.decode_csv(value_column,record_defaults=record_defaults)` -> columns = `tf.io.decode_csv(value_column,record_defaults=record_defaults)`
* `return dataset.make_one_shot_iterator().get_next()` -> `return tf.compat.v1.data.make_one_shot_iterator(dataset).get_next()`
* `net = tf.feature_column.input_layer(features, params['feature_columns'])` -> `net = tf.compat.v1.feature_column.input_layer(features, params['feature_columns'])`
* `net = tf.layers.dense(net, units=units, activation=tf.nn.relu)` -> `net = tf.compat.v1.layers.dense(net, units=units, activation=tf.nn.relu)`
* `logits = tf.layers.dense(net, params['n_classes'], activation=None)` -> `logits = tf.compat.v1.layers.dense(net, params['n_classes'], activation=None)`

Aaand I ran out of time converting the `tf.lookup.index_table_from_file(vocabulary_file="content_ids.txt")`. Tried all kinds of `tf.compat.v1` routes, `tf.disable_v2_behavior()` magic, etc.

Please convert this lab!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.