microsoft / solution-accelerator-many-models

MIT License
192 stars 87 forks source link

Dependency failure running 03_CustomScript Forecast #147

Open parasin opened 2 years ago

parasin commented 2 years ago

Steup and all previous notebooks run ok. Then at the Copy Predictions PythonScript step you get a failure with the following standard error: "[stderr]Traceback (most recent call last): [stderr] File "copy_predictions.py", line 4, in [stderr] import pandas as pd [stderr]ModuleNotFoundError: No module named 'pandas' [stderr]

Environment or Runconfig isn't set for this.

With some investigation error is at the Copy Predictions step in the 03_CustomScriptForecast notebook. I was able to remediate by creating a RunConfig and adding that to the PythonScriptStep.

from azureml.core.conda_dependencies import CondaDependencies from azureml.core import RunConfiguration

conda_deps = CondaDependencies.create(pip_packages=['sklearn', 'pandas', 'joblib', 'azureml-defaults', 'azureml-core', 'azureml-dataprep[fuse]']) run_config=RunConfiguration(conda_dependencies=conda_deps)

The following is the same but now with the added runconfig argument being set to the object

upload_predictions_step = PythonScriptStep( name="copy_predictions", script_name="copy_predictions.py", compute_target=compute, source_directory='./scripts', inputs=[output_dref, output_dir], runconfig=run_config, allow_reuse=False, arguments=['--parallel_run_step_output', output_dir, '--output_dir', output_dref, '--target_column', 'Quantity', '--timestamp_column', 'WeekStarting', '--timeseries_id_columns', 'Store', 'Brand']