浏览代码

modify warning on --tensorflow and --torch

/develop/rm-rf-new-models
vincentpierre 4 年前
当前提交
f45cf348
共有 1 个文件被更改,包括 6 次插入8 次删除
  1. 14
      ml-agents/mlagents/trainers/cli_utils.py

14
ml-agents/mlagents/trainers/cli_utils.py


logger = logging_util.get_logger(__name__)
class RaiseDeprecationWarning(argparse.Action):
class RaiseRemovedWarning(argparse.Action):
"""
Internal custom Action to raise warning when argument is called.
"""

def __call__(self, arg_parser, namespace, values, option_string=None):
logger.warning(f"The command line argument {option_string} was deprecated")
logger.warning(f"The command line argument {option_string} was removed.")
class DetectDefault(argparse.Action):

argparser.add_argument(
"--torch",
default=False,
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.",
action=RaiseRemovedWarning,
help="(Removed) Use the PyTorch framework.",
action=RaiseDeprecationWarning,
help="(Deprecated) Use the TensorFlow framework instead of PyTorch. Install TensorFlow "
"before using this option.",
action=RaiseRemovedWarning,
help="(Removed) Use the TensorFlow framework.",
)
eng_conf = argparser.add_argument_group(title="Engine Configuration")

正在加载...
取消
保存