Skip to content Skip to sidebar Skip to footer

How To Set An Environment Variable When Using Gcloud ML Engine?

All, (Environments: Windows 7, Python 3.6, Keras & tensorflow libs, gcloud ml engine) I am running certain Keras ML model examples using gcloud ml engine as introduced here. Ev

Solution 1:

I don't believe the Cloud ML Engine API provides a mechanism to set environment variables. However, you might be able to workaround this by writing a wrapper script (NB: UNTESTED CODE):

import os
import subprocess

env = os.environ.copy()
env["PYTHONHASHSEED"] = "0"

subprocess.check_call(['python', 'main.py'], env=env)

Post a Comment for "How To Set An Environment Variable When Using Gcloud ML Engine?"