Migrating from Cloud ML Beta

Cloud Machine Learning Beta is no longer available. Requests to the v1beta1 resources will fail. Please consider upgrading to the latest version of Cloud Machine Learning Engine. Refer to the reference docs and guides for usage instructions.

If you have existing trainer applications that you developed for use with Cloud Machine Learning Beta, or if you have models that you deployed during Beta, you need to make some alterations to take advantage of the Cloud ML Engine services. This page provides an overview of the steps required to bring your applications to the new standards.

Name changes

In addition to the changes in functionality, Cloud ML Engine uses different names and versions for its interfaces. Here is a summary of what's changed:

  • The new API endpoint URLs have changed from https://ml.googleapis.com/v1beta1/... to https://ml.googleapis.com/v1/....

  • If you use the Google Cloud Client Library in Python to access Cloud Machine Learning Engine API methods, you must change the version. So, instead of:

    ml = discovery.build('ml','v1beta1', credentials=credentials)

    You now use:

    ml = discovery.build('ml','v1', credentials=credentials)

    See the Python programming tutorial for more information about using the Python Client Library with Cloud ML Engine.

  • The Cloud ML Engine command group in the gcloud command-line tool has changed from gcloud beta ml to gcloud ml-engine

Changes to your trainer

As in Beta, you can run your TensorFlow training application with Cloud ML Engine without needing much adjustment, if any. However, there are some requirements for how you use TensorFlow in order to work well with the Cloud ML Engine services. You'll find the current guidance for TensorFlow in the trainer development considerations. This section highlights how those best practices have changed since Beta.

Change from Supervisor to MonitoredSession for distributed training

Since the release of Cloud ML Engine Beta, the older Supervisor (tf.train.Supervisor) has been replaced by MonitoredSession (tf.train.MonitoredSession) as the recommended class for managing distributed training.

How it affects your code

You can continue to run an existing trainer that uses Supervisor until Cloud ML Engine switches its runtime version to a version of TensorFlow that no longer supports it.

You should develop all new trainers with MonitoredSession.

Change from export_meta_graph to SavedModel for exporting models

In Beta, Cloud ML Engine supported the older TensorFlow graph serialization format generated by export_meta_graph (tf.train.export_meta_graph) for deploying your models. That format is no longer supported. Now your models must be deployed using the newer SavedModel (tf.saved_model) format.

How it affects your code

You cannot create a model version using a model saved in the old format. If you have an existing trainer that uses export_meta_graph, you must change it to use the SavedModel format in order to deploy new versions.

Change from the Cloud ML SDK to tf.Transform for preprocessing data

The Cloud ML Python SDK Alpha that was available during Beta is deprecated. You can now accomplish the tasks that it supported by using the new tf.Transform.

How it affects your code

The current Cloud ML Engine API no longer supports the old SDK. If you have an existing trainer that preprocesses data with the SDK, you'll need to update it to use tf.Transform or another data preprocessing tool.

New features

In addition to mandatory changes from Beta, Cloud ML Engine includes several new and enhanced features. These are summarized in the release notes.

What's next

Was this page helpful? Let us know how we did:

Send feedback about...

Cloud ML Engine for TensorFlow