I am getting this error when I run script job_submit.py. I do not know how to debug this issue, would appreciate help to solve this.
PS: I have just started learning azure so I am not sure what I am missing.
script_to_run.py
from azureml.core import Workspace, Dataset, Run
ws = Workspace.from_config()
az_dataset = Dataset.get_by_name(workspace=ws, name='titanic-dataset')
# Get the context of the experiment
new_run = Run.get_context()
df = az_dataset.to_pandas_dataframe()
### count the observations
total_obs = len(df)
### get the gender count
gender_count = df['Sex'].value_counts()
# log the metrics to workspace
new_run.log(name = "Total observations", value = total_obs)
### Log the gender data values
for val in df['Sex'].unique():
new_run.log(name = val, value = gender_count[val])
# complete an experiment run
new_run.complete()
job_submit.py
from azureml.core import Workspace, Datastore, Dataset, Experiment, ScriptRunConfig, Environment
# Access workspace
ws = Workspace.from_config()
# create an experiment object
exp = Experiment(workspace=ws, name = "Titanic_exp")
# create custom env - myenv
myenv = Environment(name = 'MyEnvironment')
# to install dependencies
from azureml.core.environment import CondaDependencies
# from CondaDependencies class we need to create an object which will have all the required dependencies
# create the dependencies object
packages = CondaDependencies.create(conda_packages=['pandas', 'scikit-learn']) # this will have list of all packages we will need
myenv.python.conda_dependencies = packages # this will tell to install the packages
# register environment to workspace so that we have access to it
myenv.register(ws)
# create a script configuration for custom env
script_config = ScriptRunConfig(source_directory = '.', script = "script_to_run.py", environment = myenv)
new_run = exp.submit(config = script_config)