-
Couldn't load subscription status.
- Fork 4.4k
Removing TensorFlow Trainers #4707
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
Changes from 9 commits
4f18ddc
b05bbb7
54a2c8c
597d6d9
49e5a18
e3c092d
da80f38
c8a42f7
e55ee75
18aa589
e31d90f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,21 @@ | |
| from mlagents.trainers.exception import TrainerConfigError | ||
| from mlagents_envs.environment import UnityEnvironment | ||
| import argparse | ||
| from mlagents_envs import logging_util | ||
|
|
||
| logger = logging_util.get_logger(__name__) | ||
|
|
||
|
|
||
| class RaiseDeprecationWarning(argparse.Action): | ||
| """ | ||
| Internal custom Action to raise warning when argument is called. | ||
| """ | ||
|
|
||
| def __init__(self, nargs=0, **kwargs): | ||
| super().__init__(nargs=nargs, **kwargs) | ||
|
|
||
| def __call__(self, arg_parser, namespace, values, option_string=None): | ||
| logger.warning(f"The command line argument {option_string} was deprecated") | ||
|
|
||
|
|
||
| class DetectDefault(argparse.Action): | ||
|
|
@@ -171,14 +186,14 @@ def _create_parser() -> argparse.ArgumentParser: | |
| argparser.add_argument( | ||
| "--torch", | ||
| default=False, | ||
| action=DetectDefaultStoreTrue, | ||
| help="Use the PyTorch framework. Note that this option is not required anymore as PyTorch is the" | ||
| action=RaiseDeprecationWarning, | ||
| help="(Deprecated) Use the PyTorch framework. Note that this option is not required anymore as PyTorch is the" | ||
| "default framework, and will be removed in the next release.", | ||
| ) | ||
| argparser.add_argument( | ||
| "--tensorflow", | ||
| default=False, | ||
| action=DetectDefaultStoreTrue, | ||
| action=RaiseDeprecationWarning, | ||
|
||
| help="(Deprecated) Use the TensorFlow framework instead of PyTorch. Install TensorFlow " | ||
| "before using this option.", | ||
| ) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will have to move to move to the 'Unreleased' section after release 11 (unless we are aiming to get this in for the release)