Giter VIP home page Giter VIP logo

templates-for-dynamics-365-supply-chain-management-demand-forecasting-with-azure-machine-learning's Introduction

Templates for Dynamics 365 Supply Chain Management demand forecasting with Azure Machine Learning

This repository contains template scripts that you can use to set up your Azure environment to generate demand forecasts using the Azure Machine Learning Service, which you can then integrate with the demand forecasting feature of Dynamics 365 Supply Chain Management. For details, see Demand forecasting overview.

Set up your Azure subscription to generate demand forecasts

To enable your Azure subscription to generate demand forecasts, we recommend that you run the quick_setup.ps1 script included in this repository on your Azure environment and follow the instructions provided by the script. Alternatively, you could set it up manually as described in Demand forecasting setup.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.

templates-for-dynamics-365-supply-chain-management-demand-forecasting-with-azure-machine-learning's People

Contributors

andreygarmash avatar ddavidtran avatar kamaybac avatar microsoftopensource avatar mqueva avatar yucheng-ren avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

templates-for-dynamics-365-supply-chain-management-demand-forecasting-with-azure-machine-learning's Issues

Quick_setup.ps1 out of date !

hello,
I'm installing Azure Machine learning workspace using the script "quick_setup"
here are some thing which are not working :
line 293 : $mlExtensionName = az extension list --query "[?name=='azure-cli-ml'].name" --output tsv
azure-cli-ml is not the proper name, it's "ml" only now

line 146 : $res = az ml workspace create --workspace-name $workspaceName --resource-group $resourceGroupName --storage-account $storageAccountId

"--storage-account" is not a valid parameters now (https://learn.microsoft.com/en-us/cli/azure/ml/workspace?view=azure-cli-latest#az-ml-workspace-create)

and there are many other thinks like "Invalid ARM Id /subscriptions/94a144ed-a2" after executing the "az ml workspace create"

thanks for corrections !

ImportError: cannot import name 'dataprep_stub' from 'azureml.data._dataprep_helper' (/azureml-envs/azureml_f3f7e6c5fb83d94df23933000bf02da3/lib/python3.8/site-packages/azureml/data/_dataprep_helper.py)_

Hello,

A business consultant reported me that the demand forecasting was failing in FO with a message saying that the pipeline run into an error.

After investigating, i found out this in user_logs/std_log.txt :

_Traceback (most recent call last):
  File "run.py", line 17, in <module>
    from azureml.pipeline.core import Pipeline, PipelineData
  File "/azureml-envs/azureml_f3f7e6c5fb83d94df23933000bf02da3/lib/python3.8/site-packages/azureml/pipeline/core/__init__.py", line 24, in <module>
    from .builder import PipelineStep, PipelineData, StepSequence
  File "/azureml-envs/azureml_f3f7e6c5fb83d94df23933000bf02da3/lib/python3.8/site-packages/azureml/pipeline/core/builder.py", line 17, in <module>
    from azureml.pipeline.core.graph import Graph, Node, InputPortBinding, OutputPortBinding, \
  File "/azureml-envs/azureml_f3f7e6c5fb83d94df23933000bf02da3/lib/python3.8/site-packages/azureml/pipeline/core/graph.py", line 36, in <module>
    from azureml.pipeline.core.pipeline_output_dataset import PipelineOutputAbstractDataset
  File "/azureml-envs/azureml_f3f7e6c5fb83d94df23933000bf02da3/lib/python3.8/site-packages/azureml/pipeline/core/pipeline_output_dataset.py", line 18, in <module>
    from azureml.data._dataprep_helper import dataprep_stub, dataprep
ImportError: cannot import name 'dataprep_stub' from 'azureml.data._dataprep_helper' (/azureml-envs/azureml_f3f7e6c5fb83d94df23933000bf02da3/lib/python3.8/site-packages/azureml/data/_dataprep_helper.py)_

To fix the issue, I had to update the "run.py" script in order to force importing the previous version (1.53) of the azureml-pipeline package. Then, I created a new version of the pipeline by executing the "api_trigger.py" and now, it is ok. I guess there is a breaking change in the new version (1.54) of the package ?

Best regards,
Mirko

Expected a StepRun object but received <class 'azureml.core.run.Run'> instead

When running the script from both D365 and with the sample data, getting several errors but it appears that this is the issue causing it in the std_txt file:

Expected a StepRun object but received <class 'azureml.core.run.Run'> instead.

I've also tried updating the ml packages to the latest version, but still getting the error.

DemandForecastGeneration_TriggerScript failing with package conflict error

We are getting below error, when we try to run Demand forecast experiment manually from newly created Azure Machine Learning workspace. However existing workspace working without any issue. Any one come across this issue?

Error Message:

Expected a StepRun object but received <class 'azureml.core.run.Run'> instead.
This usually indicates a package conflict with one of the dependencies of azureml-core or azureml-pipeline-core.
Please check for package conflicts in your python environment
Elapsed time: 0:28:38.617563
Cleaning up all outstanding Run operations, waiting 300.0 seconds
3 items cleaning up...
Cleanup took 0.2656395435333252 seconds
Traceback (most recent call last):
File "/azureml-envs/azureml_f3f7e6c5fb83d94df23933000bf02da3/lib/python3.8/site-packages/azureml/pipeline/core/run.py", line 295, in wait_for_completion
step_run.wait_for_completion(timeout_seconds=timeout_seconds - time_elapsed,
TypeError: wait_for_completion() got an unexpected keyword argument 'timeout_seconds'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "", line 197, in
File "", line 193, in main
File "/azureml-envs/azureml_f3f7e6c5fb83d94df23933000bf02da3/lib/python3.8/runpy.py", line 265, in run_path
return _run_module_code(code, init_globals, run_name,
File "/azureml-envs/azureml_f3f7e6c5fb83d94df23933000bf02da3/lib/python3.8/runpy.py", line 97, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "/azureml-envs/azureml_f3f7e6c5fb83d94df23933000bf02da3/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "run.py", line 163, in
runParallel(args.input_path, args.output_path)
File "run.py", line 140, in runParallel
run.wait_for_completion(show_output=True, timeout_seconds=parameters.timeout_seconds)
File "/azureml-envs/azureml_f3f7e6c5fb83d94df23933000bf02da3/lib/python3.8/site-packages/azureml/pipeline/core/run.py", line 310, in wait_for_completion
step_run.wait_for_completion(raise_on_error=raise_on_error)
File "/azureml-envs/azureml_f3f7e6c5fb83d94df23933000bf02da3/lib/python3.8/site-packages/azureml/core/run.py", line 882, in wait_for_completion
raise ActivityFailedException(error_details=json.dumps(error, indent=4))
azureml.exceptions._azureml_exception.ActivityFailedException: ActivityFailedException:
Message: Activity Failed:
{
"error": {
"code": "UserError",
"message": "Execution failed. User process 'python' exited with status code 42. Please check log file 'user_logs/std_log_5.txt' for error details. Error: Traceback (most recent call last):\n File "driver/amlbi_main.py", line 275, in \n main()\n File "driver/amlbi_main.py", line 226, in main\n sys.exit(exitcode_candidate)\nSystemExit: 42\n\n",
"messageParameters": {},
"details": []
},
"time": "0001-01-01T00:00:00.000Z",
"componentName": "CommonRuntime"
}
InnerException None
ErrorResponse
{
"error": {
"message": "Activity Failed:\n{\n "error": {\n "code": "UserError",\n "message": "Execution failed. User process 'python' exited with status code 42. Please check log file 'user_logs/std_log_5.txt' for error details. Error: Traceback (most recent call last):\n File \"driver/amlbi_main.py\", line 275, in \n main()\n File \"driver/amlbi_main.py\", line 226, in main\n sys.exit(exitcode_candidate)\nSystemExit: 42\n\n",\n "messageParameters": {},\n "details": []\n },\n "time": "0001-01-01T00:00:00.000Z",\n "componentName": "CommonRuntime"\n}"
}
}
File "run.py", line 163, in
runParallel(args.input_path, args.output_path)
File "run.py", line 140, in runParallel
run.wait_for_completion(show_output=True, timeout_seconds=parameters.timeout_seconds)
File "/azureml-envs/azureml_f3f7e6c5fb83d94df23933000bf02da3/lib/python3.8/site-packages/azureml/pipeline/core/run.py", line 310, in wait_for_completion
step_run.wait_for_completion(raise_on_error=raise_on_error)
File "/azureml-envs/azureml_f3f7e6c5fb83d94df23933000bf02da3/lib/python3.8/site-packages/azureml/core/run.py", line 882, in wait_for_completion
raise ActivityFailedException(error_details=json.dumps(error, indent=4))
azureml.exceptions._azureml_exception.ActivityFailedException: ActivityFailedException:
Message: Activity Failed:
{
"error": {
"code": "UserError",
"message": "Execution failed. User process 'python' exited with status code 42. Please check log file 'user_logs/std_log_5.txt' for error details. Error: Traceback (most recent call last):\n File "driver/amlbi_main.py", line 275, in \n main()\n File "driver/amlbi_main.py", line 226, in main\n sys.exit(exitcode_candidate)\nSystemExit: 42\n\n",
"messageParameters": {},
"details": []
},
"time": "0001-01-01T00:00:00.000Z",
"componentName": "CommonRuntime"
}
InnerException None
ErrorResponse
{
"error": {
"message": "Activity Failed:\n{\n "error": {\n "code": "UserError",\n "message": "Execution failed. User process 'python' exited with status code 42. Please check log file 'user_logs/std_log_5.txt' for error details. Error: Traceback (most recent call last):\n File \"driver/amlbi_main.py\", line 275, in \n main()\n File \"driver/amlbi_main.py\", line 226, in main\n sys.exit(exitcode_candidate)\nSystemExit: 42\n\n",\n "messageParameters": {},\n "details": []\n },\n "time": "0001-01-01T00:00:00.000Z",\n "componentName": "CommonRuntime"\n}"
}
}

AzureML pipeline package update

Hi all,

Yesterday (12/04/2023) azureml-pipeline package for python has been updated. Running the forecast through the pipeline, the package will be updated and the pipeline won't work anymore giving the error below.

I fixed the error specifying the package version to install (1.49.0). Has someone find a different solution?

Thanks,
Giuseppe

Logs

run.py logs

Traceback (most recent call last):
  File "run.py", line 20, in <module>
    from azureml.pipeline.steps import ParallelRunConfig, ParallelRunStep
  File "/azureml-envs/azureml_f3f7e6c5fb83d94df23933000bf02da3/lib/python3.8/site-packages/azureml/pipeline/steps/__init__.py", line 26, in <module>
    from .automl_step import AutoMLStep, AutoMLStepRun
  File "/azureml-envs/azureml_f3f7e6c5fb83d94df23933000bf02da3/lib/python3.8/site-packages/azureml/pipeline/steps/automl_step.py", line 26, in <module>
    from azureml.train.automl import constants
  File "/azureml-envs/azureml_f3f7e6c5fb83d94df23933000bf02da3/lib/python3.8/site-packages/azureml/train/automl/__init__.py", line 26, in <module>
    from azureml.train.automl.automlconfig import AutoMLConfig
  File "/azureml-envs/azureml_f3f7e6c5fb83d94df23933000bf02da3/lib/python3.8/site-packages/azureml/train/automl/automlconfig.py", line 17, in <module>
    from azureml._common._error_definition.user_error import \
ImportError: cannot import name 'ArgsNotSupportedForScenario' from 'azureml._common._error_definition.user_error' (/azureml-envs/azureml_f3f7e6c5fb83d94df23933000bf02da3/lib/python3.8/site-packages/azureml/_common/_error_definition/user_error.py)

Getting AttributeError: '_OfflineRun' object has no attribute 'experiment' Error when running Run.py in AML Studio notebook

Hello Team,

I was trying to follow this repo, inside my AML WS and when I added the files and tried to run them, I got multiple errors:

When I run the run.py file I get: AttributeError: '_OfflineRun' object has no attribute 'experiment'

When I run the api_trigger.py file I get:

azureuser@ruaburub3:~/cloudfiles/code/Users/ruaburub$ python api_trigger.py
Pipeline does not exists, creating new: TriggerDemandForecastGeneration
Traceback (most recent call last):
File "api_trigger.py", line 48, in
pipelineEndpoint = PipelineEndpoint.publish(workspace = workspace, name = pipelineName, pipeline=pipeline, description="Initiate demand forecast generation.")
File "/anaconda/envs/azureml_py38/lib/python3.8/site-packages/azureml/pipeline/core/pipeline_endpoint.py", line 323, in publish
pipeline = pipeline.publish(name=pipeline_name, description="Description for " + pipeline_name)
File "/anaconda/envs/azureml_py38/lib/python3.8/site-packages/azureml/pipeline/core/pipeline.py", line 309, in publish
return self.graph._save(name=name, description=description, version=version,
File "/anaconda/envs/azureml_py38/lib/python3.8/site-packages/azureml/pipeline/core/graph.py", line 3844, in _save
self._validate_and_finalize(pipeline_parameters=None, regenerate_outputs=regenerate_outputs)
File "/anaconda/envs/azureml_py38/lib/python3.8/site-packages/azureml/pipeline/core/graph.py", line 3863, in _validate_and_finalize
self.finalize(dry_run=False, regenerate_outputs=regenerate_outputs)
File "/anaconda/envs/azureml_py38/lib/python3.8/site-packages/azureml/pipeline/core/graph.py", line 3609, in finalize
Graph._check_threadpool_exceptions(done, not_done)
File "/anaconda/envs/azureml_py38/lib/python3.8/site-packages/azureml/pipeline/core/graph.py", line 3734, in _check_threadpool_exceptions
raise ex
File "/anaconda/envs/azureml_py38/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/anaconda/envs/azureml_py38/lib/python3.8/site-packages/azureml/pipeline/core/graph.py", line 3596, in get_or_create_module_for_fingerprint
raise ex
File "/anaconda/envs/azureml_py38/lib/python3.8/site-packages/azureml/pipeline/core/graph.py", line 3594, in get_or_create_module_for_fingerprint
module_id = node._module_builder.build()
File "/anaconda/envs/azureml_py38/lib/python3.8/site-packages/azureml/pipeline/core/_module_builder.py", line 62, in build
module_id = self._module_provider.create_module(
File "/anaconda/envs/azureml_py38/lib/python3.8/site-packages/azureml/pipeline/core/_aeva_provider.py", line 327, in create_module
module_entity = _AevaModuleProvider.module_creation(module_def, content_path,
File "/anaconda/envs/azureml_py38/lib/python3.8/site-packages/azureml/pipeline/core/_aeva_provider.py", line 293, in module_creation
storage_id = module_uploader.upload(directory=content_path)
File "/anaconda/envs/azureml_py38/lib/python3.8/site-packages/azureml/pipeline/core/_aeva_provider.py", line 81, in upload
storage_id = snapshots_client.create_snapshot(directory)
File "/anaconda/envs/azureml_py38/lib/python3.8/site-packages/azureml/_restclient/snapshots_client.py", line 110, in create_snapshot
self._validate_snapshot_file_count(file_or_folder_path, len(entries_to_send), raise_on_validation_failure)
File "/anaconda/envs/azureml_py38/lib/python3.8/site-packages/azureml/_restclient/snapshots_client.py", line 79, in _validate_snapshot_file_count
raise SnapshotException(error_message)
azureml.exceptions._azureml_exception.SnapshotException: SnapshotException:
Message: ====================================================================

While attempting to take snapshot of /mnt/batch/tasks/shared/LS_root/mounts/clusters/ruaburub3/code/Users/ruaburub
Your project exceeds the file limit of 2000.

====================================================================

    InnerException None
    ErrorResponse 

{
"error": {
"message": "====================================================================\n\nWhile attempting to take snapshot of /mnt/batch/tasks/shared/LS_root/mounts/clusters/ruaburub3/code/Users/ruaburub\nYour project exceeds the file limit of 2000.\n\n====================================================================\n\n"
}
}

And When I run the forecast.r I get:
azureuser@ruaburub3:~/cloudfiles/code/Users/ruaburub/REntryScript$ Rscript forecast.r
/bin/bash: /anaconda/envs/azureml_py38/lib/libtinfo.so.6: no version information available (required by /bin/bash)
Error in library(forecast) : there is no package called ‘forecast’
Execution halted

This is how my files look like:
image

Missing azureml-data

ERROR: Could not find a version that satisfies the requirement azureml-data (from versions: none)
ERROR: No matching distribution found for azureml-data

DemandForecastGeneration_TriggerScript failing from last three weeks

We are getting below error, from last three weeks (this issue appearing when creating new pipeline or running existing from Demand forecast), any one come across this issue?

Error:
Expected a StepRun object but received <class 'azureml.core.run.Run'> instead.
This usually indicates a package conflict with one of the dependencies of azureml-core or azureml-pipeline-core.
Please check for package conflicts in your python environment
Elapsed time: 0:14:03.650006
Cleaning up all outstanding Run operations, waiting 300.0 seconds
3 items cleaning up...
Cleanup took 0.235382080078125 seconds
Traceback (most recent call last):
File "/azureml-envs/azureml_f3f7e6c5fb83d94df23933000bf02da3/lib/python3.8/site-packages/azureml/pipeline/core/run.py", line 295, in wait_for_completion
step_run.wait_for_completion(timeout_seconds=timeout_seconds - time_elapsed,
TypeError: wait_for_completion() got an unexpected keyword argument 'timeout_seconds'

Compute instance name hardcoded in quick_setup.ps1

The compute instance name is hardcoded in quick_setup.ps1, but is required to be unique within the Azure region. Creation is likely to fail with a message similar to:

ERROR: {'Azure-cli-ml Version': '1.41.0', 'Error': ComputeTargetException:
        Message: Compute name 'notebookScryptExecutor' is not available. Reason: AlreadyExists. Message: The specified name notebookScryptExecutor is already in use and is therefore unavailable
        InnerException None
        ErrorResponse
{
    "error": {
        "message": "Compute name 'notebookScryptExecutor' is not available. Reason: AlreadyExists. Message: The specified name notebookScryptExecutor is already in use and is therefore unavailable"
    }
}}

Modifying the script to change the name is an effective workaround.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.