ageron / ageron/handson-ml2

Chapter 19 - KeyError in GCP Prediction Service Model Version Mismatch

Open
#174 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
30k
Forks
13.1k
PR merge metrics
No merged PRs in 30d

Description

If you deploy Model v2 to GCP (as per page 680 .../my_mnist_model/0002/) then parsing of the prediction results fails due to a Key Error, eg:

KeyError: 'dense_2'

This occurs because the output_name is still assigned to the value from v1, eg 'dense_1'. Resetting the output_name to the v2 value prior to calling Predict allows the results to be parsed correctly

output_name = model.output_names[0]

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.