diff --git a/RELEASE.md b/RELEASE.md index 7b7bcebaa4fe9d62f6ff8d0587a90137d9ed3363..fb5827d5eca73991654d069dca5a1446cfcc0eec 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -9,8 +9,8 @@ * Web UI supports language internationalization, including both Chinese and English. ## Bugfixes -* Optimize UI page initialization to handle timeout requests. [!503](https://gitee.com/mindspore/mindinsight/pulls/503) -* Fix the line break problem when the profiling file number is too long. [532](https://gitee.com/mindspore/mindinsight/pulls/532) +* Optimize UI page initialization to handle timeout requests. ([!503](https://gitee.com/mindspore/mindinsight/pulls/503)) +* Fix the line break problem when the profiling file number is too long. ([!532](https://gitee.com/mindspore/mindinsight/pulls/532)) ## Thanks to our Contributors Thanks goes to these wonderful people: diff --git a/mindinsight/wizard/cli.py b/mindinsight/wizard/cli.py index 7e4356647702f9463ab28467fbacfef7c98eb9a5..ab975fc1ea3efe4ed193c30b1ca722152c74b99d 100644 --- a/mindinsight/wizard/cli.py +++ b/mindinsight/wizard/cli.py @@ -28,7 +28,7 @@ def cli_entry(): os.umask(permissions << 3 | permissions) parser = argparse.ArgumentParser( - prog='wizard', + prog='mindwizard', description='MindWizard CLI entry point (version: {})'.format(mindinsight.__version__)) parser.add_argument( diff --git a/mindinsight/wizard/conf/templates/network/alexnet/train.py-tpl b/mindinsight/wizard/conf/templates/network/alexnet/train.py-tpl index ead7ddc8db79a51b23f941d32561e31f06b1cc0a..07b30fff42d2272be5013272cbd8b6a26ce773da 100644 --- a/mindinsight/wizard/conf/templates/network/alexnet/train.py-tpl +++ b/mindinsight/wizard/conf/templates/network/alexnet/train.py-tpl @@ -41,7 +41,7 @@ if __name__ == "__main__": parser = argparse.ArgumentParser(description='MindSpore AlexNet Example') parser.add_argument('--run_distribute', type=bool, default=False, help='Run distribute') parser.add_argument('--device_num', type=int, default=1, help='Device num') - parser.add_argument('--device_target', type=str, default="Ascend", choices=['Ascend', 'GPU', 'CPU'], + parser.add_argument('--device_target', type=str, default="Ascend", choices=['Ascend', 'GPU'], help='device where the code will be implemented (default: Ascend)') parser.add_argument('--dataset_path', type=str, default="./", help='path where the dataset is saved') parser.add_argument('--pre_trained', type=str, default=None, help='Pre-trained checkpoint path') diff --git a/mindinsight/wizard/conf/templates/network/lenet/eval.py-tpl b/mindinsight/wizard/conf/templates/network/lenet/eval.py-tpl index 2f77ebdd994e6a1e27ad14ba74634fc948508e6a..60a76dde273c1915ee6f5b2a82a7ed34b4213403 100644 --- a/mindinsight/wizard/conf/templates/network/lenet/eval.py-tpl +++ b/mindinsight/wizard/conf/templates/network/lenet/eval.py-tpl @@ -33,7 +33,7 @@ from src.lenet import LeNet5 if __name__ == "__main__": parser = argparse.ArgumentParser(description='MindSpore Lenet Example') - parser.add_argument('--device_target', type=str, default="Ascend", choices=['Ascend', 'GPU', 'CPU'], + parser.add_argument('--device_target', type=str, default="Ascend", choices=['Ascend', 'GPU'], help='device where the code will be implemented (default: Ascend)') parser.add_argument('--dataset_path', type=str, default="./Data", help='path where the dataset is saved') diff --git a/mindinsight/wizard/conf/templates/network/lenet/train.py-tpl b/mindinsight/wizard/conf/templates/network/lenet/train.py-tpl index 6e5a8376379468060fb3ad74a74a91a5432e03e8..23b2512039bf3f5426db93483e6852b84ba14a89 100644 --- a/mindinsight/wizard/conf/templates/network/lenet/train.py-tpl +++ b/mindinsight/wizard/conf/templates/network/lenet/train.py-tpl @@ -36,7 +36,7 @@ if __name__ == "__main__": parser = argparse.ArgumentParser(description='MindSpore Lenet Example') parser.add_argument('--run_distribute', type=bool, default=False, help='Run distribute') parser.add_argument('--device_num', type=int, default=1, help='Device num.') - parser.add_argument('--device_target', type=str, default="Ascend", choices=['Ascend', 'GPU', 'CPU'], + parser.add_argument('--device_target', type=str, default="Ascend", choices=['Ascend', 'GPU'], help='device where the code will be implemented (default: Ascend)') parser.add_argument('--dataset_path', type=str, default="./Data", help='path where the dataset is saved') @@ -45,9 +45,6 @@ if __name__ == "__main__": args = parser.parse_args() - if args.device_target == "CPU": - args.dataset_sink = False - context.set_context(mode=context.GRAPH_MODE, device_target=args.device_target) ckpt_save_dir = './' if args.run_distribute: diff --git a/mindinsight/wizard/conf/templates/network/resnet50/train.py-tpl b/mindinsight/wizard/conf/templates/network/resnet50/train.py-tpl index 218e6cc6cedf70b00853500a1ac757e740f14723..1f4fbb5f3e392faa8bbeaa47885552df7f18fc1e 100644 --- a/mindinsight/wizard/conf/templates/network/resnet50/train.py-tpl +++ b/mindinsight/wizard/conf/templates/network/resnet50/train.py-tpl @@ -36,7 +36,7 @@ parser.add_argument('--run_distribute', type=bool, default=False, help='Run dist parser.add_argument('--device_num', type=int, default=1, help='Device num.') parser.add_argument('--dataset_path', type=str, default=None, help='Dataset path') -parser.add_argument('--device_target', type=str, default='Ascend', help='Device target: "Ascend", "GPU", "CPU"') +parser.add_argument('--device_target', type=str, default='Ascend', help='Device target: "Ascend", "GPU"') parser.add_argument('--pre_trained', type=str, default=None, help='Pretrained checkpoint path') parser.add_argument('--dataset_sink_mode', type=str, default='True', choices = ['True', 'False'], help='DataSet sink mode is True or False') diff --git a/mindinsight/wizard/create_project.py b/mindinsight/wizard/create_project.py index ee93b2fef3c68a5e5052feaf525fb1d6216fcabe..21c89ecd1619fdeca5b43f5e539778108afc2c85 100644 --- a/mindinsight/wizard/create_project.py +++ b/mindinsight/wizard/create_project.py @@ -59,7 +59,8 @@ class CreateProject(BaseCommand): def _check_project_dir(project_name): """Check project directory whether empty or exist.""" if not re.search('^[A-Za-z0-9][A-Za-z0-9._-]*$', project_name): - raise CommandError("'%s' is not a valid project name. Please input a valid name" % project_name) + raise CommandError("'%s' is not a valid project name. Please input a valid name matching " + "regex ^[A-Za-z0-9][A-Za-z0-9._-]*$" % project_name) project_dir = os.path.join(os.getcwd(), project_name) if os.path.exists(project_dir): output_path = Path(project_dir) @@ -81,19 +82,23 @@ class CreateProject(BaseCommand): '\n'.join(f'{idx: >4}: {choice}' for idx, choice in enumerate(network_type_choices, start=1)) ) prompt_type = click.IntRange(min=1, max=len(network_type_choices)) - choice = click.prompt(prompt_msg, type=prompt_type, hide_input=False, show_choices=False, - confirmation_prompt=False, - value_proc=lambda x: process_prompt_choice(x, prompt_type)) + choice = 0 + while not choice: + choice = click.prompt(prompt_msg, default=0, type=prompt_type, + hide_input=False, show_choices=False, + confirmation_prompt=False, show_default=False, + value_proc=lambda x: process_prompt_choice(x, prompt_type)) + if not choice: + click.secho(textwrap.dedent("Network is required."), fg='red') + return network_type_choices[choice - 1] @staticmethod def echo_notice(): """Echo notice for depending environment.""" - click.secho(textwrap.dedent(""" - [NOTICE] To ensure the final generated scripts run under specific environment with the following - - mindspore : %s - """ % SUPPORT_MINDSPORE_VERSION), fg='red') + click.secho(textwrap.dedent( + "[NOTICE] The final generated scripts should be run under environment " + "where mindspore==%s and related device drivers are installed. " % SUPPORT_MINDSPORE_VERSION), fg='yellow') def run(self, args): """Override run method to start.""" diff --git a/mindinsight/wizard/network/generic_network.py b/mindinsight/wizard/network/generic_network.py index 05f41849f3d979342224d664d134663ae69dbabc..d19edcba28751aa63db2e77a9e511b9602652ff7 100644 --- a/mindinsight/wizard/network/generic_network.py +++ b/mindinsight/wizard/network/generic_network.py @@ -14,6 +14,7 @@ # ============================================================================ """GenericNetwork module.""" import os +import textwrap import click @@ -93,6 +94,7 @@ class GenericNetwork(BaseNetwork): choice = click.prompt(prompt_msg, type=prompt_type, hide_input=False, show_choices=False, confirmation_prompt=False, default=default_choice, value_proc=lambda x: process_prompt_choice(x, prompt_type)) + click.secho(textwrap.dedent("Your choice is %s." % choice_contents[choice - 1]), fg='yellow') return choice_contents[choice - 1] def ask_loss_function(self):