Harry Stuart
Harry Stuart

Reputation: 1945

Google Cloud ML using Python 2.7

I have a ML python script that I have submitted as a job to Google Cloud ML, but kept getting a syntax error when using * to unpack a list. Then I realised that my code was getting executed in Python V2.7. Why would this be the case, can Google Cloud ML be set to use Python V3.?

Thanks

Upvotes: 1

Views: 77

Answers (1)

Harsha Biyani
Harsha Biyani

Reputation: 7268

As mentioned in Google document,

AI Platform runs Python 2.7 by default. Python 3.5 is available when you use AI Platform runtime version 1.4 or greater.

ex:

training_inputs = {'scaleTier': 'BASIC',
    'packageUris': ['gs://my/trainer/path/package-0.0.0.tar.gz'],
    'pythonModule': 'trainer.task'
    'args': ['--arg1', 'value1', '--arg2', 'value2'],
    'region': 'us-central1',
    'jobDir': 'gs://my/training/job/directory',
    'runtimeVersion': '1.13',
    'pythonVersion': '3.5'}

for more info, please refer :

https://cloud.google.com/ml-engine/docs/tensorflow/environment-overview

https://cloud.google.com/ml-engine/docs/tensorflow/versioning#set-python-version-training

Upvotes: 2

Related Questions