Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[debug] Require all behavior names to have a matching YAML entry #5210

Merged
merged 18 commits into from
Apr 19, 2021

Conversation

ervteng
Copy link
Contributor

@ervteng ervteng commented Mar 31, 2021

Proposed change(s)

For most cases, require that the behavior name be specified in the RunOptions, or that default_settings is set. The exception is the case that no YAML is specified at all; then, use default parameters for all settings.

Note that the Changelog conflict was merged assuming this would be cherry-picked into R17.

Useful links (Github issues, JIRA tickets, ML-Agents forum threads etc.)

JIRA MLA-1865

Types of change(s)

  • Bug fix
  • New feature
  • Code refactor
  • Breaking change - potentially, if user relied on default parameters
  • Documentation update
  • Other (please describe)

Checklist

  • Added tests that prove my fix is effective or that my feature works
  • Updated the changelog (if applicable)
  • Updated the documentation (if applicable)
  • Updated the migration guide (if applicable)

Other comments

@ervteng ervteng requested a review from chriselion March 31, 2021 22:49
@ervteng ervteng removed the request for review from chriselion April 1, 2021 14:43
@ervteng ervteng requested a review from vincentpierre April 1, 2021 15:34
@ervteng ervteng changed the title [debug] Add --strict option to CLI [debug] Require all behavior names to have a matching YAML entry Apr 5, 2021
Copy link
Contributor

@vincentpierre vincentpierre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry it took me so long. I have some questions about the code that I left in comments.

Comment on lines 862 to 863
# If we're loading for a file, make sure we have strict on
configured_dict["strict"] = True
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be simpler to remove these two lines and make strict True by default rather than False line 817 ?

@@ -800,6 +814,7 @@ class RunOptions(ExportableSettings):
# These are options that are relevant to the run itself, and not the engine or environment.
# They will be left here.
debug: bool = parser.get_default("debug")
strict: bool = False
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a little comment here on what strict does?

ml-agents/mlagents/trainers/settings.py Show resolved Hide resolved
@ervteng ervteng merged commit 86a4070 into main Apr 19, 2021
@delete-merged-branch delete-merged-branch bot deleted the develop-strict-behaviornames branch April 19, 2021 21:41
ervteng pushed a commit that referenced this pull request Apr 20, 2021
* Add strict check to settings.py

* Remove warning from trainer factory, add test

* Add changelog

* Fix test

* Update changelog

* Remove strict CLI options

* Remove strict option, rename, make strict default

* Remove newline

* Update comments

* Set default dict to actually default to a default dict

* Fix tests

* Fix tests again

* Default trainer dict to requiring all fields

* Fix settings typing

* Use logger

* Add default_settings to error

(cherry picked from commit 86a4070)
ervteng pushed a commit that referenced this pull request Apr 22, 2021
…) (#5296)

* Add strict check to settings.py

* Remove warning from trainer factory, add test

* Add changelog

* Fix test

* Update changelog

* Remove strict CLI options

* Remove strict option, rename, make strict default

* Remove newline

* Update comments

* Set default dict to actually default to a default dict

* Fix tests

* Fix tests again

* Default trainer dict to requiring all fields

* Fix settings typing

* Use logger

* Add default_settings to error

(cherry picked from commit 86a4070)
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants