| @@ -30,8 +30,8 @@ MindInsight provides MindSpore with easy-to-use debugging and tuning capabilitie | |||||
|  |  | ||||
| Click to view the [MindInsight design document](https://www.mindspore.cn/doc/note/en/master/design/mindinsight.html), learn more about the design. | |||||
| Click to view the [Tutorial documentation](https://www.mindspore.cn/tutorial/training/en/master/advanced_use/visualization_tutorials.html) learn more about the MindInsight tutorial. | |||||
| Click to view the [MindInsight design document](https://www.mindspore.cn/doc/note/en/r1.1/design/mindinsight.html), learn more about the design. | |||||
| Click to view the [Tutorial documentation](https://www.mindspore.cn/tutorial/training/en/r1.1/advanced_use/visualization_tutorials.html) learn more about the MindInsight tutorial. | |||||
| ## Installation | ## Installation | ||||
| @@ -46,7 +46,7 @@ Click to view the [Tutorial documentation](https://www.mindspore.cn/tutorial/tra | |||||
| - Confirm that [node.js](https://nodejs.org/en/download/) 10.19.0 or later is installed. | - Confirm that [node.js](https://nodejs.org/en/download/) 10.19.0 or later is installed. | ||||
| - Confirm that [wheel](https://pypi.org/project/wheel/) 0.32.0 or later is installed. | - Confirm that [wheel](https://pypi.org/project/wheel/) 0.32.0 or later is installed. | ||||
| - Confirm that [pybind11](https://pypi.org/project/pybind11/) 2.4.3 or later is installed. | - Confirm that [pybind11](https://pypi.org/project/pybind11/) 2.4.3 or later is installed. | ||||
| - All other dependencies are included in [requirements.txt](https://gitee.com/mindspore/mindinsight/blob/master/requirements.txt). | |||||
| - All other dependencies are included in [requirements.txt](https://gitee.com/mindspore/mindinsight/blob/r1.1/requirements.txt). | |||||
| ### Installation Methods | ### Installation Methods | ||||
| @@ -58,7 +58,7 @@ You can install MindInsight either by pip or by source code. | |||||
| pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/{version}/MindInsight/ascend/{system}/mindinsight-{version}-cp37-cp37m-linux_{arch}.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple | pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/{version}/MindInsight/ascend/{system}/mindinsight-{version}-cp37-cp37m-linux_{arch}.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple | ||||
| ``` | ``` | ||||
| > - When the network is connected, dependency items are automatically downloaded during .whl package installation. (For details about other dependency items, see [requirements.txt](https://gitee.com/mindspore/mindinsight/blob/master/requirements.txt)). In other cases, you need to manually install dependency items. | |||||
| > - When the network is connected, dependency items are automatically downloaded during .whl package installation. (For details about other dependency items, see [requirements.txt](https://gitee.com/mindspore/mindinsight/blob/r1.1/requirements.txt)). In other cases, you need to manually install dependency items. | |||||
| > - `{version}` denotes the version of MindInsight. For example, when you are downloading MindSpore 1.0.1, `{version}` should be 1.0.1. | > - `{version}` denotes the version of MindInsight. For example, when you are downloading MindSpore 1.0.1, `{version}` should be 1.0.1. | ||||
| > - `{arch}` denotes the system architecture. For example, the Linux system you are using is x86 architecture 64-bit, `{arch}` should be `x86_64`. If the system is ARM architecture 64-bit, then it should be `aarch64`. | > - `{arch}` denotes the system architecture. For example, the Linux system you are using is x86 architecture 64-bit, `{arch}` should be `x86_64`. If the system is ARM architecture 64-bit, then it should be `aarch64`. | ||||
| > - `{system}` denotes the system version. For example, if you are using EulerOS ARM architecture, `{system}` should be `euleros_aarch64`. Currently, the following systems are supported by Ascend: `euleros_aarch64`/`centos_aarch64`/`centos_x86`/`ubuntu_aarch64`/`ubuntu_x86`. `ubuntu_x86` is supported by GPU. | > - `{system}` denotes the system version. For example, if you are using EulerOS ARM architecture, `{system}` should be `euleros_aarch64`. Currently, the following systems are supported by Ascend: `euleros_aarch64`/`centos_aarch64`/`centos_x86`/`ubuntu_aarch64`/`ubuntu_x86`. `ubuntu_x86` is supported by GPU. | ||||
| @@ -112,7 +112,7 @@ service start state: success | |||||
| Before using MindInsight, the data in the training process should be recorded. When starting MindInsight, the directory of the saved data should be specified. After successful startup, the data can be viewed through the web page. Here is a brief introduction to recording training data, as well as starting and stopping MindInsight. | Before using MindInsight, the data in the training process should be recorded. When starting MindInsight, the directory of the saved data should be specified. After successful startup, the data can be viewed through the web page. Here is a brief introduction to recording training data, as well as starting and stopping MindInsight. | ||||
| [SummaryCollector](https://www.mindspore.cn/doc/api_python/en/master/mindspore/mindspore.train.html#mindspore.train.callback.SummaryCollector) is the interface MindSpore provides for a quick and easy collection of common data about computational graphs, loss values, learning rates, parameter weights, and so on. Below is an example of using `SummaryCollector` for data collection, specifying the directory where the data is stored in `./summary_dir`. | |||||
| [SummaryCollector](https://www.mindspore.cn/doc/api_python/en/r1.1/mindspore/mindspore.train.html#mindspore.train.callback.SummaryCollector) is the interface MindSpore provides for a quick and easy collection of common data about computational graphs, loss values, learning rates, parameter weights, and so on. Below is an example of using `SummaryCollector` for data collection, specifying the directory where the data is stored in `./summary_dir`. | |||||
| ```python | ```python | ||||
| ... | ... | ||||
| @@ -122,7 +122,7 @@ summary_collector = SummaryCollector(summary_dir='./summary_dir') | |||||
| model.train(epoch=1, ds_train, callbacks=[summary_collector]) | model.train(epoch=1, ds_train, callbacks=[summary_collector]) | ||||
| ``` | ``` | ||||
| For more ways to record visual data, see the [MindInsight Tutorial](https://www.mindspore.cn/tutorial/training/en/master/advanced_use/visualization_tutorials.html). | |||||
| For more ways to record visual data, see the [MindInsight Tutorial](https://www.mindspore.cn/tutorial/training/en/r1.1/advanced_use/visualization_tutorials.html). | |||||
| After you've collected the data, when you launch MindInsight, specify the directory in which the data has been stored. | After you've collected the data, when you launch MindInsight, specify the directory in which the data has been stored. | ||||
| @@ -30,8 +30,8 @@ MindInsight为MindSpore提供了简单易用的调优调试能力。在训练过 | |||||
|  |  | ||||
| 点击查看[MindInsight设计文档](https://www.mindspore.cn/doc/note/zh-CN/master/design/mindinsight.html),了解更多设计详情。 | |||||
| 点击查看[教程文档](https://www.mindspore.cn/tutorial/training/zh-CN/master/advanced_use/visualization_tutorials.html),了解更多MindInsight教程。 | |||||
| 点击查看[MindInsight设计文档](https://www.mindspore.cn/doc/note/zh-CN/r1.1/design/mindinsight.html),了解更多设计详情。 | |||||
| 点击查看[教程文档](https://www.mindspore.cn/tutorial/training/zh-CN/r1.1/advanced_use/visualization_tutorials.html),了解更多MindInsight教程。 | |||||
| ## 安装 | ## 安装 | ||||
| @@ -46,7 +46,7 @@ MindInsight为MindSpore提供了简单易用的调优调试能力。在训练过 | |||||
| - 确认安装[node.js](https://nodejs.org/en/download/) 10.19.0及以上版本。 | - 确认安装[node.js](https://nodejs.org/en/download/) 10.19.0及以上版本。 | ||||
| - 确认安装[wheel](https://pypi.org/project/wheel/) 0.32.0及以上版本。 | - 确认安装[wheel](https://pypi.org/project/wheel/) 0.32.0及以上版本。 | ||||
| - 确认安装[pybind11](https://pypi.org/project/pybind11/) 2.4.3及以上版本。 | - 确认安装[pybind11](https://pypi.org/project/pybind11/) 2.4.3及以上版本。 | ||||
| - 其他依赖参见[requirements.txt](https://gitee.com/mindspore/mindinsight/blob/master/requirements.txt)。 | |||||
| - 其他依赖参见[requirements.txt](https://gitee.com/mindspore/mindinsight/blob/r1.1/requirements.txt)。 | |||||
| ### 安装方式 | ### 安装方式 | ||||
| @@ -58,7 +58,7 @@ MindInsight为MindSpore提供了简单易用的调优调试能力。在训练过 | |||||
| pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/{version}/MindInsight/ascend/{system}/mindinsight-{version}-cp37-cp37m-linux_{arch}.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple | pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/{version}/MindInsight/ascend/{system}/mindinsight-{version}-cp37-cp37m-linux_{arch}.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple | ||||
| ``` | ``` | ||||
| > - 在联网状态下,安装whl包时会自动下载MindInsight安装包的依赖项(依赖项详情参见[requirements.txt](https://gitee.com/mindspore/mindinsight/blob/master/requirements.txt)),其余情况需自行安装。 | |||||
| > - 在联网状态下,安装whl包时会自动下载MindInsight安装包的依赖项(依赖项详情参见[requirements.txt](https://gitee.com/mindspore/mindinsight/blob/r1.1/requirements.txt)),其余情况需自行安装。 | |||||
| > - `{version}`表示MindInsight版本号,例如下载1.0.1版本MindInsight时,`{version}`应写为1.0.1。 | > - `{version}`表示MindInsight版本号,例如下载1.0.1版本MindInsight时,`{version}`应写为1.0.1。 | ||||
| > - `{arch}`表示系统架构,例如使用的Linux系统是x86架构64位时,`{arch}`应写为`x86_64`。如果系统是ARM架构64位,则写为`aarch64`。 | > - `{arch}`表示系统架构,例如使用的Linux系统是x86架构64位时,`{arch}`应写为`x86_64`。如果系统是ARM架构64位,则写为`aarch64`。 | ||||
| > - `{system}`表示系统版本,例如使用的欧拉系统ARM架构,`{system}`应写为`euleros_aarch64`,目前Ascend版本可支持以下系统`euleros_aarch64`/`centos_aarch64`/`centos_x86`/`ubuntu_aarch64`/`ubuntu_x86`;GPU版本可支持以下系统`ubuntu_x86`。 | > - `{system}`表示系统版本,例如使用的欧拉系统ARM架构,`{system}`应写为`euleros_aarch64`,目前Ascend版本可支持以下系统`euleros_aarch64`/`centos_aarch64`/`centos_x86`/`ubuntu_aarch64`/`ubuntu_x86`;GPU版本可支持以下系统`ubuntu_x86`。 | ||||
| @@ -113,7 +113,7 @@ service start state: success | |||||
| 使用MindInsight前,需要先将训练过程中的数据记录下来,启动MindInsight时,指定所保存的数据的位置,启动成功后, | 使用MindInsight前,需要先将训练过程中的数据记录下来,启动MindInsight时,指定所保存的数据的位置,启动成功后, | ||||
| 即可通过可视化页面查看数据。下面将简单介绍记录训练过程数据,以及启动、停止MindInsight服务。 | 即可通过可视化页面查看数据。下面将简单介绍记录训练过程数据,以及启动、停止MindInsight服务。 | ||||
| [SummaryCollector](https://www.mindspore.cn/doc/api_python/zh-CN/master/mindspore/mindspore.train.html#mindspore.train.callback.SummaryCollector)是MindSpore提供的快速简易地收集一些常见信息的接口,收集的信息包括计算图、损失值、学习率、参数权重等。 | |||||
| [SummaryCollector](https://www.mindspore.cn/doc/api_python/zh-CN/r1.1/mindspore/mindspore.train.html#mindspore.train.callback.SummaryCollector)是MindSpore提供的快速简易地收集一些常见信息的接口,收集的信息包括计算图、损失值、学习率、参数权重等。 | |||||
| 下面是使用 `SummaryCollector` 进行数据收集的示例,其中指定存放数据的目录为 `./summary_dir`。 | 下面是使用 `SummaryCollector` 进行数据收集的示例,其中指定存放数据的目录为 `./summary_dir`。 | ||||
| ```python | ```python | ||||
| @@ -124,7 +124,7 @@ summary_collector = SummaryCollector(summary_dir='./summary_dir') | |||||
| model.train(epoch=1, ds_train, callbacks=[summary_collector]) | model.train(epoch=1, ds_train, callbacks=[summary_collector]) | ||||
| ``` | ``` | ||||
| 更多记录可视化数据的方法,请点击查看[MindInsight使用教程](https://www.mindspore.cn/tutorial/training/zh-CN/master/advanced_use/visualization_tutorials.html)。 | |||||
| 更多记录可视化数据的方法,请点击查看[MindInsight使用教程](https://www.mindspore.cn/tutorial/training/zh-CN/r1.1/advanced_use/visualization_tutorials.html)。 | |||||
| 收集好数据后,启动MindInsight时指定存放数据的目录。 | 收集好数据后,启动MindInsight时指定存放数据的目录。 | ||||
| @@ -10,13 +10,9 @@ | |||||
| * check activation range | * check activation range | ||||
| * check gradient vanishing | * check gradient vanishing | ||||
| * check tensor overflow | * check tensor overflow | ||||
| * Support rechecking with new watch points on the same data. | * Support rechecking with new watch points on the same data. | ||||
| * Newly designed tensor view with fix suggestions and tensor context to quickly locate root cause of problems. | * Newly designed tensor view with fix suggestions and tensor context to quickly locate root cause of problems. | ||||
| * Support recommending watch points to find common precision problems. | * Support recommending watch points to find common precision problems. | ||||
| * Support debugger on multigraph network. | * Support debugger on multigraph network. | ||||
| ### Profiler | ### Profiler | ||||
| @@ -37,6 +33,16 @@ Provide explanations and their benchmarks for image classification deep CNN mode | |||||
| * Support 4 benchmark methods: Localization, Faithfulness, Class Sensitivity, Robustness | * Support 4 benchmark methods: Localization, Faithfulness, Class Sensitivity, Robustness | ||||
| * Provide a high-level API (ImageClassificationRunner) for users to execute explanation methods and benchmark methods and store the results easily. | * Provide a high-level API (ImageClassificationRunner) for users to execute explanation methods and benchmark methods and store the results easily. | ||||
| ## API Change | |||||
| ### Improvements | |||||
| #### Command Line Interface | |||||
| * `--enable_debugger`: Support both 1 and True ([!1051](https://gitee.com/mindspore/mindinsight/pulls/1051)) | |||||
| * `ENABLE_MS_DEBUGGER`: Support both 1 and True ([!10199](https://gitee.com/mindspore/mindspore/pulls/10199)) | |||||
| * `parse_summary`: Add parse_summary function to convert summary file to image file and csv file ([!774](https://gitee.com/mindspore/mindinsight/pulls/774)) | |||||
| ## Bugfixes | ## Bugfixes | ||||
| ### Profiler | ### Profiler | ||||
| @@ -113,7 +119,7 @@ Contributions of any kind are welcome! | |||||
| ## Bugfixes | ## Bugfixes | ||||
| * UI fix for the error message display mode of the tensor during real-time training. ([!465](https://gitee.com/mindspore/mindinsight/pulls/465)) | * UI fix for the error message display mode of the tensor during real-time training. ([!465](https://gitee.com/mindspore/mindinsight/pulls/465)) | ||||
| * The summary file size is larger than max_file_size. ([!3481](https://gitee.com/mindspore/dashboard/projects/mindspore/mindspore/pulls/3481)) | |||||
| * The summary file size is larger than max_file_size. ([!3481](https://gitee.com/mindspore/mindspore/pulls/3481)) | |||||
| * Fix real-time training error when disk is full. ([!3058](https://gitee.com/mindspore/mindspore/pulls/3058)) | * Fix real-time training error when disk is full. ([!3058](https://gitee.com/mindspore/mindspore/pulls/3058)) | ||||
| ## Thanks to our Contributors | ## Thanks to our Contributors | ||||
| @@ -1,4 +1,4 @@ | |||||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||||
| # Copyright 2020-2021 Huawei Technologies Co., Ltd | |||||
| # | # | ||||
| # Licensed under the Apache License, Version 2.0 (the "License"); | # Licensed under the Apache License, Version 2.0 (the "License"); | ||||
| # you may not use this file except in compliance with the License. | # you may not use this file except in compliance with the License. | ||||
| @@ -14,4 +14,4 @@ | |||||
| # ============================================================================ | # ============================================================================ | ||||
| """Mindinsight version module.""" | """Mindinsight version module.""" | ||||
| VERSION = '1.1.0' | |||||
| VERSION = '1.1.2' | |||||
| @@ -0,0 +1,26 @@ | |||||
| # Copyright 2021 Huawei Technologies Co., Ltd | |||||
| # | |||||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||||
| # you may not use this file except in compliance with the License. | |||||
| # You may obtain a copy of the License at | |||||
| # | |||||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||||
| # | |||||
| # Unless required by applicable law or agreed to in writing, software | |||||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
| # See the License for the specific language governing permissions and | |||||
| # limitations under the License. | |||||
| # ============================================================================ | |||||
| """UI config module init file.""" | |||||
| from mindinsight.backend.ui_config.ui_config_api import init_module as init_config_module | |||||
| def init_module(app): | |||||
| """ | |||||
| Init module entry. | |||||
| Args: | |||||
| app (Flask): A Flask instance. | |||||
| """ | |||||
| init_config_module(app) | |||||
| @@ -0,0 +1,40 @@ | |||||
| # Copyright 2021 Huawei Technologies Co., Ltd | |||||
| # | |||||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||||
| # you may not use this file except in compliance with the License. | |||||
| # You may obtain a copy of the License at | |||||
| # | |||||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||||
| # | |||||
| # Unless required by applicable law or agreed to in writing, software | |||||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
| # See the License for the specific language governing permissions and | |||||
| # limitations under the License. | |||||
| # ============================================================================ | |||||
| """UI config restful api.""" | |||||
| from flask import Blueprint, jsonify | |||||
| from mindinsight.conf import settings | |||||
| BLUEPRINT = Blueprint("ui_config", __name__, | |||||
| url_prefix=settings.URL_PATH_PREFIX + settings.API_PREFIX) | |||||
| @BLUEPRINT.route("/ui-config", methods=["GET"]) | |||||
| def get_config(): | |||||
| """Get config of UI.""" | |||||
| reply = {} | |||||
| enable_debugger = settings.ENABLE_DEBUGGER if hasattr(settings, 'ENABLE_DEBUGGER') else False | |||||
| reply["enable_debugger"] = enable_debugger | |||||
| return jsonify(reply) | |||||
| def init_module(app): | |||||
| """ | |||||
| Init module entry. | |||||
| Args: | |||||
| app (Flask): The application obj. | |||||
| """ | |||||
| app.register_blueprint(BLUEPRINT) | |||||
| @@ -50,6 +50,11 @@ class TensorProcessor(BaseProcessor): | |||||
| """ | """ | ||||
| Validation.check_param_empty(train_id=train_ids, tag=tags) | Validation.check_param_empty(train_id=train_ids, tag=tags) | ||||
| try: | |||||
| dims = unquote(dims, errors='strict') if dims else None | |||||
| except UnicodeDecodeError: | |||||
| raise UrlDecodeError('Unquote dims error with strict mode') | |||||
| for index, train_id in enumerate(train_ids): | for index, train_id in enumerate(train_ids): | ||||
| try: | try: | ||||
| train_id = unquote(train_id, errors='strict') | train_id = unquote(train_id, errors='strict') | ||||
| @@ -110,6 +110,7 @@ class ActivationFuncEnum(Enum): | |||||
| TANH = 'tanh' | TANH = 'tanh' | ||||
| SIGMOID = 'sigmoid' | SIGMOID = 'sigmoid' | ||||
| RELU = 'relu' | RELU = 'relu' | ||||
| RELUV2 = 'reluv2' | |||||
| class ConditionContext: | class ConditionContext: | ||||
| @@ -115,7 +115,8 @@ def recommend_watchpoints(condition_mgr: ConditionMgr, graph_stream, condition_c | |||||
| _recommend_activation_range(merged_info, condition_mgr, watch_points, condition_context, | _recommend_activation_range(merged_info, condition_mgr, watch_points, condition_context, | ||||
| ActivationFuncEnum.SIGMOID.value) | ActivationFuncEnum.SIGMOID.value) | ||||
| merged_info = get_basic_node_info(TargetTypeEnum.ACTIVATION.value, graph_stream, ActivationFuncEnum.RELU.value) | |||||
| merged_info = get_basic_node_info(TargetTypeEnum.ACTIVATION.value, graph_stream, | |||||
| [ActivationFuncEnum.RELU.value, ActivationFuncEnum.RELUV2.value]) | |||||
| _recommend_activation_range(merged_info, condition_mgr, watch_points, condition_context, | _recommend_activation_range(merged_info, condition_mgr, watch_points, condition_context, | ||||
| ActivationFuncEnum.RELU.value) | ActivationFuncEnum.RELU.value) | ||||
| return watch_points | return watch_points | ||||
| @@ -415,7 +416,7 @@ def _add_graph_name(nodes, graph_stream): | |||||
| def _sigmoid(value): | def _sigmoid(value): | ||||
| """Calculate the sigmoid of value.""" | """Calculate the sigmoid of value.""" | ||||
| return 1.0 / (1.0 + math.exp(value)) | |||||
| return 1.0 / (1.0 + math.exp(-value)) | |||||
| def _get_recommend_activation_params(condition, activation_func): | def _get_recommend_activation_params(condition, activation_func): | ||||
| @@ -79,16 +79,19 @@ class DebuggerServer: | |||||
| if not isinstance(set_recommended, bool): | if not isinstance(set_recommended, bool): | ||||
| log.error("Bool param should be given for set_recommended") | log.error("Bool param should be given for set_recommended") | ||||
| raise DebuggerParamValueError("Bool param should be given.") | raise DebuggerParamValueError("Bool param should be given.") | ||||
| metadata_stream = self.cache_store.get_stream_handler(Streams.METADATA) | metadata_stream = self.cache_store.get_stream_handler(Streams.METADATA) | ||||
| if metadata_stream.recommendation_confirmed: | if metadata_stream.recommendation_confirmed: | ||||
| log.error("User has confirmed setting recommended watchpoints") | log.error("User has confirmed setting recommended watchpoints") | ||||
| raise DebuggerSetRecommendWatchpointsError() | raise DebuggerSetRecommendWatchpointsError() | ||||
| metadata_stream.recommendation_confirmed = True | |||||
| condition_context = ConditionContext(metadata_stream.backend, metadata_stream.step) | condition_context = ConditionContext(metadata_stream.backend, metadata_stream.step) | ||||
| log.debug("Train_id: %s, backend: %s", train_id, condition_context.backend) | log.debug("Train_id: %s, backend: %s", train_id, condition_context.backend) | ||||
| res = metadata_stream.get(['state', 'enable_recheck']) | res = metadata_stream.get(['state', 'enable_recheck']) | ||||
| if set_recommended: | if set_recommended: | ||||
| res['id'] = self._add_recommended_watchpoints(condition_context) | res['id'] = self._add_recommended_watchpoints(condition_context) | ||||
| metadata_stream.recommendation_confirmed = True | |||||
| return res | return res | ||||
| def _add_recommended_watchpoints(self, condition_context): | def _add_recommended_watchpoints(self, condition_context): | ||||
| @@ -156,7 +156,7 @@ Supported models list (Models in below table have been tested based on PyTorch 1 | |||||
| | DenseNet161 | [Link](https://github.com/pytorch/vision/blob/v0.5.0/torchvision/models/densenet.py) | / | | | | DenseNet161 | [Link](https://github.com/pytorch/vision/blob/v0.5.0/torchvision/models/densenet.py) | / | | | ||||
| | NASNetMobile/Large | / | [Link](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/keras/applications/nasnet.py) | | | | NASNetMobile/Large | / | [Link](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/keras/applications/nasnet.py) | | | ||||
| | EfficientNetB0~B7 | [Link](https://github.com/lukemelas/EfficientNet-PyTorch) | [TF1.5Link](https://github.com/tensorflow/tpu/tree/master/models/official/efficientnet) [TF2.3Link](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/keras/applications/efficientnet.py) | | | | EfficientNetB0~B7 | [Link](https://github.com/lukemelas/EfficientNet-PyTorch) | [TF1.5Link](https://github.com/tensorflow/tpu/tree/master/models/official/efficientnet) [TF2.3Link](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/keras/applications/efficientnet.py) | | | ||||
| | Unet | [Link](https://github.com/milesial/Pytorch-UNet) | [Link](https://github.com/zhixuhao/unet) | Due to Operator `ResizeBilinear` not achieved on GPU device, Operator `ResizeBilinear` should be replaced by operator `ResizeNearest`, while running in GPU device | | |||||
| | Unet | [Link](https://github.com/milesial/Pytorch-UNet) | [Link](https://github.com/zhixuhao/unet) | Due to Operator `mindspore.ops.ResizeBilinear` is not implemented on GPU device for now, operator `mindspore.ops.ResizeBilinear` should be replaced by operator `mindspore.ops.ResizeNearestNeighbor`, while running in GPU device | | |||||
| ## Example | ## Example | ||||
| @@ -311,7 +311,7 @@ class ConvBNReLU(nn.Sequential): | |||||
| ## Requirements | ## Requirements | ||||
| For users using MindConverter, in addition to install the TensorFlow can satisfy the pb model loading, inference and training, users also need to pip install the following third party package (tf2onnx is not required for users that convert PyTorch model definition script to MindSpore): | |||||
| For users using MindConverter, in addition to install the TensorFlow that can satisfy the model loading, inference and training requirements, users also need to pip install the following third party package (tf2onnx is not required for users that convert PyTorch model definition script to MindSpore): | |||||
| ```text | ```text | ||||
| onnx>=1.8.0 | onnx>=1.8.0 | ||||
| @@ -417,7 +417,7 @@ def convert_to_froze_graph(keras_model: tf.python.keras.models.Model, model_name | |||||
| | GraphInitFailError | Fail to trace the computational graph | 1000000 | Exception caused by 1000001~1000003 | | | GraphInitFailError | Fail to trace the computational graph | 1000000 | Exception caused by 1000001~1000003 | | ||||
| | ModelNotSupportError | Fail to parse .pth/.pb file | 1000001 | Given `--input_nodes`, `--output_nodes don't match the input model; Meanwhile, the model file can not be loaded also can cause this error. | | | ModelNotSupportError | Fail to parse .pth/.pb file | 1000001 | Given `--input_nodes`, `--output_nodes don't match the input model; Meanwhile, the model file can not be loaded also can cause this error. | | ||||
| | TfRuntimeError | Fail to initialize the TF runtime | 1000002 | Resources required by TensorFlow are not available | | | TfRuntimeError | Fail to initialize the TF runtime | 1000002 | Resources required by TensorFlow are not available | | ||||
| | ModelLoadingFailError | Fail to load the model | 1000003 | Maybe cause by the wrong `--input_shape` value | | |||||
| | ModelLoadingError | Fail to load the model | 1000003 | Maybe cause by the wrong `--input_shape` value | | |||||
| | RuntimeIntegrityError | Fail to locate required third party dependency | 1000004 | Caused by required third party packages are not installed | | | RuntimeIntegrityError | Fail to locate required third party dependency | 1000004 | Caused by required third party packages are not installed | | ||||
| | TreeCreateFailError | Fail to create code hierarchical tree | 2000000 | Mainly caused by usage of `torch.nn.functional.xxx`, `torch.xxx`, `torch.Tensor.xxx` in PyTorch | | | TreeCreateFailError | Fail to create code hierarchical tree | 2000000 | Mainly caused by usage of `torch.nn.functional.xxx`, `torch.xxx`, `torch.Tensor.xxx` in PyTorch | | ||||
| | NodeInputMissingError | Fail to get the input node info | 2000001 | Fail to get input node info | | | NodeInputMissingError | Fail to get the input node info | 2000001 | Fail to get input node info | | ||||
| @@ -155,7 +155,7 @@ MindConverter提供两种技术方案,以应对不同脚本迁移场景: | |||||
| | DenseNet161 | [脚本链接](https://github.com/pytorch/vision/blob/v0.5.0/torchvision/models/densenet.py) | 暂未测试 | | | | DenseNet161 | [脚本链接](https://github.com/pytorch/vision/blob/v0.5.0/torchvision/models/densenet.py) | 暂未测试 | | | ||||
| | NASNetMobile/Large | 暂未测试 | [脚本链接](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/keras/applications/nasnet.py) | | | | NASNetMobile/Large | 暂未测试 | [脚本链接](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/keras/applications/nasnet.py) | | | ||||
| | EfficientNetB0~B7 | [脚本链接](https://github.com/lukemelas/EfficientNet-PyTorch) | [TF1.5脚本链接](https://github.com/tensorflow/tpu/tree/master/models/official/efficientnet) [TF2.3脚本链接](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/keras/applications/efficientnet.py) | | | | EfficientNetB0~B7 | [脚本链接](https://github.com/lukemelas/EfficientNet-PyTorch) | [TF1.5脚本链接](https://github.com/tensorflow/tpu/tree/master/models/official/efficientnet) [TF2.3脚本链接](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/keras/applications/efficientnet.py) | | | ||||
| | Unet | [脚本链接](https://github.com/milesial/Pytorch-UNet) | [脚本链接](https://github.com/zhixuhao/unet) | 由于算子`ResizeBilinear`在GPU上未实现,所以当运行在GPU设备上时,算子`ResizeBilinear`需要被替换为算子`ResizeNearest` | | |||||
| | Unet | [脚本链接](https://github.com/milesial/Pytorch-UNet) | [脚本链接](https://github.com/zhixuhao/unet) | 由于算子`mindspore.ops.ResizeBilinear`在GPU上暂未实现,所以当运行在GPU设备上时,算子`mindspore.ops.ResizeBilinear`需要被替换为算子`mindspore.ops.ResizeNearestNeighbor` | | |||||
| ## 使用示例 | ## 使用示例 | ||||
| @@ -431,7 +431,7 @@ def convert_to_froze_graph(keras_model: tf.python.keras.models.Model, model_name | |||||
| | GraphInitFailError | 依据网络模型构建计算图失败 | 1000000 | 由1000001,1000002,1000003导致的计算图无法解析。 | | | GraphInitFailError | 依据网络模型构建计算图失败 | 1000000 | 由1000001,1000002,1000003导致的计算图无法解析。 | | ||||
| | ModelNotSupportError | 解析.pth/.pb文件失败 | 1000001 | 给定的`--input_nodes`, `--output_nodes`与实际模型不符;或模型文件存在问题导致模型无法加载。 | | | ModelNotSupportError | 解析.pth/.pb文件失败 | 1000001 | 给定的`--input_nodes`, `--output_nodes`与实际模型不符;或模型文件存在问题导致模型无法加载。 | | ||||
| | TfRuntimeError | TensorFlow库执行出错 | 1000002 | TensorFlow启动申请所需资源失败导致无法正常启动,请检查系统资源(进程数、内存、显存占用、CPU占用)是否充足。 | | | TfRuntimeError | TensorFlow库执行出错 | 1000002 | TensorFlow启动申请所需资源失败导致无法正常启动,请检查系统资源(进程数、内存、显存占用、CPU占用)是否充足。 | | ||||
| | ModelLoadingFailError | 模型加载失败 | 1000003 | 可能由于用户给定网络输入尺寸错误导致模型无法加载。 | | |||||
| | ModelLoadingError | 模型加载失败 | 1000003 | 可能由于用户给定网络输入尺寸错误导致模型无法加载。 | | |||||
| | RuntimeIntegrityError | 三方依赖库不完整 | 1000004 | MindConverter运行时所需的三方依赖库未安装。 | | | RuntimeIntegrityError | 三方依赖库不完整 | 1000004 | MindConverter运行时所需的三方依赖库未安装。 | | ||||
| | TreeCreateFailError | 依据计算图构建模型树失败 | 2000000 | Tree用于生成最终代码结构,通常由于PyTorch网络中存在`torch.nn.functional.xxx`, `torch.xxx`, `torch.Tensor.xxx`算子导致。 | | | TreeCreateFailError | 依据计算图构建模型树失败 | 2000000 | Tree用于生成最终代码结构,通常由于PyTorch网络中存在`torch.nn.functional.xxx`, `torch.xxx`, `torch.Tensor.xxx`算子导致。 | | ||||
| | NodeInputMissingError | 网络节点输入信息丢失 | 2000001 | 节点的输入信息丢失。 | | | NodeInputMissingError | 网络节点输入信息丢失 | 2000001 | 节点的输入信息丢失。 | | ||||
| @@ -22,6 +22,7 @@ from marshmallow import ValidationError | |||||
| from mindinsight.profiler.common.exceptions.exceptions import \ | from mindinsight.profiler.common.exceptions.exceptions import \ | ||||
| ProfilerParamValueErrorException, ProfilerDirNotFoundException | ProfilerParamValueErrorException, ProfilerDirNotFoundException | ||||
| from mindinsight.datavisual.common.exceptions import TrainJobNotExistError | |||||
| from mindinsight.profiler.common.log import logger as log | from mindinsight.profiler.common.log import logger as log | ||||
| @@ -144,10 +145,18 @@ def validate_and_normalize_profiler_path(summary_dir, summary_base_dir): | |||||
| unquote_path = unquote(summary_dir, errors='strict') | unquote_path = unquote(summary_dir, errors='strict') | ||||
| except UnicodeDecodeError: | except UnicodeDecodeError: | ||||
| raise ProfilerParamValueErrorException('Unquote error with strict mode') | raise ProfilerParamValueErrorException('Unquote error with strict mode') | ||||
| profiler_base_dir = os.path.join(summary_base_dir, unquote_path) | |||||
| train_job_dir = os.path.join(summary_base_dir, unquote_path) | |||||
| try: | |||||
| train_job_dir_abs = validate_and_normalize_path(train_job_dir, 'train_job_dir') | |||||
| except ValidationError: | |||||
| log.error('train_job dir <%s> is invalid', train_job_dir) | |||||
| raise ProfilerParamValueErrorException('train_job dir is invalid.') | |||||
| if not os.path.exists(train_job_dir_abs): | |||||
| raise TrainJobNotExistError(error_detail=train_job_dir_abs) | |||||
| try: | try: | ||||
| profiler_name_list = [] | profiler_name_list = [] | ||||
| for dir_name in os.listdir(profiler_base_dir): | |||||
| for dir_name in os.listdir(train_job_dir_abs): | |||||
| search_res = re.search(profiler_directory_pattern, dir_name) | search_res = re.search(profiler_directory_pattern, dir_name) | ||||
| if search_res: | if search_res: | ||||
| profiler_name_list.append(search_res[0]) | profiler_name_list.append(search_res[0]) | ||||
| @@ -155,7 +164,7 @@ def validate_and_normalize_profiler_path(summary_dir, summary_base_dir): | |||||
| profiler_name_newest = profiler_name_list[-1] | profiler_name_newest = profiler_name_list[-1] | ||||
| profiler_dir = os.path.join(summary_base_dir, unquote_path, profiler_name_newest) | profiler_dir = os.path.join(summary_base_dir, unquote_path, profiler_name_newest) | ||||
| except ValidationError: | except ValidationError: | ||||
| log.error('no valid profiler dir under <%s>', profiler_base_dir) | |||||
| log.error('no valid profiler dir under <%s>', train_job_dir_abs) | |||||
| raise ProfilerDirNotFoundException('Profiler dir not found.') | raise ProfilerDirNotFoundException('Profiler dir not found.') | ||||
| try: | try: | ||||
| profiler_dir = validate_and_normalize_path(profiler_dir, 'profiler') | profiler_dir = validate_and_normalize_path(profiler_dir, 'profiler') | ||||
| @@ -29,7 +29,7 @@ limitations under the License. | |||||
| class="el-menu-demo" | class="el-menu-demo" | ||||
| mode="horizontal"> | mode="horizontal"> | ||||
| <el-menu-item index="/summary-manage">{{$t("summaryManage.summaryList")}}</el-menu-item> | <el-menu-item index="/summary-manage">{{$t("summaryManage.summaryList")}}</el-menu-item> | ||||
| <el-menu-item index="/debugger">{{$t("debugger.debugger")}}</el-menu-item> | |||||
| <el-menu-item index="/debugger" v-if="showDebugger">{{$t("debugger.debugger")}}</el-menu-item> | |||||
| <el-menu-item index="/explain">{{$t("explain.explain")}}</el-menu-item> | <el-menu-item index="/explain">{{$t("explain.explain")}}</el-menu-item> | ||||
| </el-menu> | </el-menu> | ||||
| </div> | </div> | ||||
| @@ -107,6 +107,7 @@ export default { | |||||
| isLanguage: true, | isLanguage: true, | ||||
| timeReloadValue: this.$store.state.timeReloadValue, | timeReloadValue: this.$store.state.timeReloadValue, | ||||
| newReloadValue: this.$store.state.timeReloadValue, | newReloadValue: this.$store.state.timeReloadValue, | ||||
| showDebugger: window.enableDebugger, | |||||
| }; | }; | ||||
| }, | }, | ||||
| computed: { | computed: { | ||||
| @@ -25,6 +25,7 @@ import i18n from './i18n'; | |||||
| import $ from 'jquery'; | import $ from 'jquery'; | ||||
| import locale from 'element-ui/lib/locale/lang/en'; | import locale from 'element-ui/lib/locale/lang/en'; | ||||
| import localezh from 'element-ui/lib/locale/lang/zh-CN'; | import localezh from 'element-ui/lib/locale/lang/zh-CN'; | ||||
| import {basePath} from '@/services/fetcher'; | |||||
| let language = window.localStorage.getItem('milang'); | let language = window.localStorage.getItem('milang'); | ||||
| const languageList = ['zh-cn', 'en-us']; | const languageList = ['zh-cn', 'en-us']; | ||||
| @@ -44,6 +45,10 @@ Vue.prototype.$bus = new Vue(); | |||||
| // Route interception | // Route interception | ||||
| router.beforeEach((to, from, next) => { | router.beforeEach((to, from, next) => { | ||||
| if (!window.enableDebugger && to.path === '/debugger') { | |||||
| next('/'); | |||||
| return; | |||||
| } | |||||
| // cancel request | // cancel request | ||||
| if (from.path !== '/') { | if (from.path !== '/') { | ||||
| store.commit('clearToken'); | store.commit('clearToken'); | ||||
| @@ -83,12 +88,10 @@ function isBrowserSupport() { | |||||
| return false; | return false; | ||||
| } | } | ||||
| } | } | ||||
| window.onload = function(e) { | |||||
| if (isBrowserSupport()) { | |||||
| Vue.prototype.$warmBrowser = true; | |||||
| } | |||||
| // Instantiation | |||||
| /** | |||||
| * Instantiate App | |||||
| */ | |||||
| function appInstantiation() { | |||||
| setTimeout(() => { | setTimeout(() => { | ||||
| new Vue({ | new Vue({ | ||||
| router, | router, | ||||
| @@ -97,4 +100,25 @@ window.onload = function(e) { | |||||
| render: (h) => h(App), | render: (h) => h(App), | ||||
| }).$mount('#app'); | }).$mount('#app'); | ||||
| }, 100); | }, 100); | ||||
| } | |||||
| window.enableDebugger = true; | |||||
| window.onload = function(e) { | |||||
| if (isBrowserSupport()) { | |||||
| Vue.prototype.$warmBrowser = true; | |||||
| } | |||||
| $.ajax({ | |||||
| url: `${basePath}v1/mindinsight/ui-config`, | |||||
| type: 'GET', | |||||
| dataType: 'json', | |||||
| success: (data) => { | |||||
| if (data) { | |||||
| window.enableDebugger = data.enable_debugger; | |||||
| } | |||||
| appInstantiation(); | |||||
| }, | |||||
| error: ()=> { | |||||
| appInstantiation(); | |||||
| }, | |||||
| }); | |||||
| }; | }; | ||||
| @@ -152,9 +152,11 @@ export default { | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| this.loadingInstance.close(); | |||||
| }, | }, | ||||
| (err) => { | (err) => { | ||||
| this.showErrorMsg(err); | this.showErrorMsg(err); | ||||
| this.loadingInstance.close(); | |||||
| }, | }, | ||||
| ); | ); | ||||
| }, | }, | ||||
| @@ -163,7 +165,9 @@ export default { | |||||
| */ | */ | ||||
| getNextNodeInfo() { | getNextNodeInfo() { | ||||
| this.loadingInstance = this.$loading(this.loadingOption); | this.loadingInstance = this.$loading(this.loadingOption); | ||||
| this.pagination.currentPage = 1; | |||||
| this.watchPointHits = []; | this.watchPointHits = []; | ||||
| this.pagination.total = 0; | |||||
| const params = { | const params = { | ||||
| mode: 'continue', | mode: 'continue', | ||||
| level: 'node', | level: 'node', | ||||
| @@ -449,6 +453,8 @@ export default { | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } else { | |||||
| this.loadingInstance.close(); | |||||
| } | } | ||||
| } | } | ||||
| if (metadata.step && metadata.step > this.metadata.step) { | if (metadata.step && metadata.step > this.metadata.step) { | ||||
| @@ -498,6 +504,7 @@ export default { | |||||
| this.radio1 = 'hit'; | this.radio1 = 'hit'; | ||||
| this.pagination.currentPage = 1; | this.pagination.currentPage = 1; | ||||
| this.watchPointHits = []; | this.watchPointHits = []; | ||||
| this.pagination.total = 0; | |||||
| this.searchWatchpointHits(true); | this.searchWatchpointHits(true); | ||||
| } | } | ||||
| @@ -531,6 +538,7 @@ export default { | |||||
| if (type !== 3) { | if (type !== 3) { | ||||
| this.pagination.currentPage = 1; | this.pagination.currentPage = 1; | ||||
| this.watchPointHits = []; | this.watchPointHits = []; | ||||
| this.pagination.total = 0; | |||||
| } | } | ||||
| const params = {}; | const params = {}; | ||||
| if (type === 0) { | if (type === 0) { | ||||
| @@ -591,6 +599,7 @@ export default { | |||||
| this.enableRecheck = res.data.metadata.enable_recheck; | this.enableRecheck = res.data.metadata.enable_recheck; | ||||
| this.pagination.currentPage = 1; | this.pagination.currentPage = 1; | ||||
| this.watchPointHits = []; | this.watchPointHits = []; | ||||
| this.pagination.total = 0; | |||||
| } | } | ||||
| if (res.data.metadata.state) { | if (res.data.metadata.state) { | ||||
| this.metadata.state = res.data.metadata.state; | this.metadata.state = res.data.metadata.state; | ||||
| @@ -1308,6 +1317,11 @@ export default { | |||||
| val.indeterminate = true; | val.indeterminate = true; | ||||
| node.indeterminate = true; | node.indeterminate = true; | ||||
| } | } | ||||
| if (val.data.watched === this.checkboxStatus.checked) { | |||||
| val.checked = true; | |||||
| } else if (val.data.watched === this.checkboxStatus.unchecked) { | |||||
| val.checked = false; | |||||
| } | |||||
| }); | }); | ||||
| [...new Set(curHalfCheckedKeys.concat(this.$refs.tree.getHalfCheckedKeys()))].forEach((val) => { | [...new Set(curHalfCheckedKeys.concat(this.$refs.tree.getHalfCheckedKeys()))].forEach((val) => { | ||||
| this.$refs.tree.getNode(val).indeterminate = true; | this.$refs.tree.getNode(val).indeterminate = true; | ||||
| @@ -1575,6 +1589,7 @@ export default { | |||||
| } | } | ||||
| if (res.data && res.data.watch_point_hits) { | if (res.data && res.data.watch_point_hits) { | ||||
| this.hitsOutdated = res.data.outdated; | this.hitsOutdated = res.data.outdated; | ||||
| this.watchPointHits = []; | |||||
| this.pagination.total = res.data.total; | this.pagination.total = res.data.total; | ||||
| this.pagination.currentPage = res.data.offset + 1; | this.pagination.currentPage = res.data.offset + 1; | ||||
| this.dealWatchpointHits(res.data.watch_point_hits); | this.dealWatchpointHits(res.data.watch_point_hits); | ||||
| @@ -1588,6 +1603,7 @@ export default { | |||||
| this.searchWatchpointHits(false); | this.searchWatchpointHits(false); | ||||
| } | } | ||||
| } else { | } else { | ||||
| this.pagination.currentPage = 1; | |||||
| this.watchPointHits = []; | this.watchPointHits = []; | ||||
| this.pagination.total = 0; | this.pagination.total = 0; | ||||
| } | } | ||||
| @@ -1609,7 +1625,6 @@ export default { | |||||
| } | } | ||||
| }, | }, | ||||
| dealWatchpointHits(data) { | dealWatchpointHits(data) { | ||||
| this.watchPointHits = []; | |||||
| if (data && data.length) { | if (data && data.length) { | ||||
| data.forEach((hit) => { | data.forEach((hit) => { | ||||
| const obj = { | const obj = { | ||||
| @@ -1651,6 +1666,10 @@ export default { | |||||
| this.watchPointHits.push(obj); | this.watchPointHits.push(obj); | ||||
| }); | }); | ||||
| this.focusWatchpointHit(); | this.focusWatchpointHit(); | ||||
| } else { | |||||
| this.pagination.currentPage = 1; | |||||
| this.watchPointHits = []; | |||||
| this.pagination.total = 0; | |||||
| } | } | ||||
| }, | }, | ||||
| focusWatchpointHit() { | focusWatchpointHit() { | ||||
| @@ -97,7 +97,6 @@ limitations under the License. | |||||
| @node-collapse="nodeCollapse" | @node-collapse="nodeCollapse" | ||||
| @node-click="handleNodeClick" | @node-click="handleNodeClick" | ||||
| node-key="name" | node-key="name" | ||||
| :default-checked-keys="defaultCheckedArr" | |||||
| :expand-on-click-node="false" | :expand-on-click-node="false" | ||||
| :lazy="lazy" | :lazy="lazy" | ||||
| :highlight-current="true" | :highlight-current="true" | ||||
| @@ -130,7 +129,6 @@ limitations under the License. | |||||
| :load="loadSearchNode" | :load="loadSearchNode" | ||||
| :lazy="true" | :lazy="true" | ||||
| node-key="name" | node-key="name" | ||||
| :default-checked-keys="searchCheckedArr" | |||||
| :expand-on-click-node="false" | :expand-on-click-node="false" | ||||
| @node-click="handleNodeClick" | @node-click="handleNodeClick" | ||||
| :show-checkbox="!!curWatchPointId" | :show-checkbox="!!curWatchPointId" | ||||
| @@ -887,6 +885,7 @@ export default { | |||||
| } else if (this.oldState === this.state.running || oldValue === this.state.running) { | } else if (this.oldState === this.state.running || oldValue === this.state.running) { | ||||
| this.pagination.currentPage = 1; | this.pagination.currentPage = 1; | ||||
| this.watchPointHits = []; | this.watchPointHits = []; | ||||
| this.pagination.total = 0; | |||||
| this.searchWatchpointHits(true); | this.searchWatchpointHits(true); | ||||
| } | } | ||||
| } | } | ||||
| @@ -1044,7 +1043,7 @@ export default { | |||||
| (res) => { | (res) => { | ||||
| if (res.data && res.data.graph) { | if (res.data && res.data.graph) { | ||||
| const graph = res.data.graph; | const graph = res.data.graph; | ||||
| this.curNodeData = graph.nodes.map((val) => { | |||||
| this.origialTree = graph.nodes.map((val) => { | |||||
| return { | return { | ||||
| label: val.name.split('/').pop(), | label: val.name.split('/').pop(), | ||||
| ...val, | ...val, | ||||
| @@ -1053,17 +1052,17 @@ export default { | |||||
| }); | }); | ||||
| this.node.childNodes = []; | this.node.childNodes = []; | ||||
| this.curWatchPointId = id; | this.curWatchPointId = id; | ||||
| this.resolve(this.curNodeData); | |||||
| this.resolve(this.origialTree); | |||||
| this.$refs.tree.getCheckedKeys().forEach((val) => { | this.$refs.tree.getCheckedKeys().forEach((val) => { | ||||
| this.$refs.tree.setChecked(val, false); | this.$refs.tree.setChecked(val, false); | ||||
| }); | }); | ||||
| // watched 0:unchecked 1:indeterminate 2:checked -1:no checkbox | // watched 0:unchecked 1:indeterminate 2:checked -1:no checkbox | ||||
| this.defaultCheckedArr = this.curNodeData | |||||
| this.defaultCheckedArr = this.origialTree | |||||
| .filter((val) => { | .filter((val) => { | ||||
| return val.watched === this.checkboxStatus.checked; | return val.watched === this.checkboxStatus.checked; | ||||
| }) | }) | ||||
| .map((val) => val.name); | .map((val) => val.name); | ||||
| const halfSelectArr = this.curNodeData | |||||
| const halfSelectArr = this.origialTree | |||||
| .filter((val) => { | .filter((val) => { | ||||
| return val.watched === this.checkboxStatus.indeterminate; | return val.watched === this.checkboxStatus.indeterminate; | ||||
| }) | }) | ||||
| @@ -1072,6 +1071,11 @@ export default { | |||||
| if (halfSelectArr.indexOf(val.data.name) !== -1) { | if (halfSelectArr.indexOf(val.data.name) !== -1) { | ||||
| val.indeterminate = true; | val.indeterminate = true; | ||||
| } | } | ||||
| if (val.data.watched === this.checkboxStatus.checked) { | |||||
| val.checked = true; | |||||
| } else if (val.data.watched === this.checkboxStatus.unchecked) { | |||||
| val.checked = false; | |||||
| } | |||||
| }); | }); | ||||
| this.firstFloorNodes = []; | this.firstFloorNodes = []; | ||||
| @@ -1278,6 +1282,7 @@ export default { | |||||
| continueTo() { | continueTo() { | ||||
| this.pagination.currentPage = 1; | this.pagination.currentPage = 1; | ||||
| this.watchPointHits = []; | this.watchPointHits = []; | ||||
| this.pagination.total = 0; | |||||
| const params = { | const params = { | ||||
| mode: 'continue', | mode: 'continue', | ||||
| level: 'node', | level: 'node', | ||||
| @@ -1520,6 +1525,7 @@ export default { | |||||
| } | } | ||||
| } | } | ||||
| this.isHitIntoView = true; | this.isHitIntoView = true; | ||||
| this.loadingInstance.close(); | |||||
| }, | }, | ||||
| /** | /** | ||||
| * The node information of the selected node. | * The node information of the selected node. | ||||
| @@ -174,7 +174,6 @@ export default { | |||||
| curBenchX: 'stepData', // Front axle reference | curBenchX: 'stepData', // Front axle reference | ||||
| curAxisName: this.$t('scalar.step'), // Current chart tip | curAxisName: this.$t('scalar.step'), // Current chart tip | ||||
| axisBenchChangeTimer: null, // Horizontal axis reference switching timing | axisBenchChangeTimer: null, // Horizontal axis reference switching timing | ||||
| summaryInOnePoint: {}, // The summary chart which in 'one-point' state | |||||
| }; | }; | ||||
| }, | }, | ||||
| @@ -201,9 +200,11 @@ export default { | |||||
| } | } | ||||
| this.originDataArr.forEach((sampleObject) => { | this.originDataArr.forEach((sampleObject) => { | ||||
| if (sampleObject.charObj) { | |||||
| sampleObject.charObj.off('dataZoom'); | |||||
| sampleObject.charObj.off('restore'); | |||||
| if (sampleObject.dataZoomYTimer) { | |||||
| clearTimeout(sampleObject.dataZoomYTimer); | |||||
| } | |||||
| if (sampleObject.dataZoomXTimer) { | |||||
| clearTimeout(sampleObject.dataZoomXTimer); | |||||
| } | } | ||||
| }); | }); | ||||
| }, | }, | ||||
| @@ -316,7 +317,9 @@ export default { | |||||
| charOption: {}, | charOption: {}, | ||||
| }, | }, | ||||
| zoomData: [null, null], | zoomData: [null, null], | ||||
| zoomDataTimer: null, | |||||
| zoomDataX: [null, null], | |||||
| zoomDataYTimer: null, | |||||
| zoomDataXTimer: null, | |||||
| charObj: null, | charObj: null, | ||||
| }); | }); | ||||
| @@ -556,7 +559,8 @@ export default { | |||||
| legendSelectData[summaryName] = false; | legendSelectData[summaryName] = false; | ||||
| legendSelectData[curBackName] = false; | legendSelectData[curBackName] = false; | ||||
| } | } | ||||
| if (dataObj.data.length === 1 || this.summaryInOnePoint[dataObj.name]) { | |||||
| const onePoint = 1; | |||||
| if (dataObj.data.length === onePoint) { | |||||
| dataObj.showSymbol = true; | dataObj.showSymbol = true; | ||||
| } | } | ||||
| seriesData.push(dataObj, dataObjBackend); | seriesData.push(dataObj, dataObjBackend); | ||||
| @@ -590,7 +594,24 @@ export default { | |||||
| color: '#9EA4B3', | color: '#9EA4B3', | ||||
| interval: 0, | interval: 0, | ||||
| rotate: that.isActive === 2 ? 0 : 90, | rotate: that.isActive === 2 ? 0 : 90, | ||||
| formatter(value) { | |||||
| formatter: (value) => { | |||||
| if (sampleObject.zoomDataXTimer) { | |||||
| clearTimeout(sampleObject.zoomDataXTimer); | |||||
| sampleObject.zoomDataXTimer = setTimeout(() => { | |||||
| sampleObject.zoomDataXTimer = null; | |||||
| this.calIfOnePoint(sampleObject); | |||||
| }, 50); | |||||
| if (value < sampleObject.zoomDataX[0]) { | |||||
| sampleObject.zoomDataX[0] = value; | |||||
| } else if (sampleObject.zoomDataX[1] < value) { | |||||
| sampleObject.zoomDataX[1] = value; | |||||
| } | |||||
| } else { | |||||
| sampleObject.zoomDataX = [value, value]; | |||||
| sampleObject.zoomDataXTimer = setTimeout(() => { | |||||
| sampleObject.zoomDataXTimer = null; | |||||
| }, 50); | |||||
| } | |||||
| if (that.isActive === 2) { | if (that.isActive === 2) { | ||||
| if (sampleObject.fullScreen) { | if (sampleObject.fullScreen) { | ||||
| const date = new Date(value * 1000); | const date = new Date(value * 1000); | ||||
| @@ -636,11 +657,12 @@ export default { | |||||
| axisLabel: { | axisLabel: { | ||||
| color: '#9EA4B3', | color: '#9EA4B3', | ||||
| formatter(value) { | |||||
| if (sampleObject.zoomDataTimer) { | |||||
| clearTimeout(sampleObject.zoomDataTimer); | |||||
| sampleObject.zoomDataTimer = setTimeout(() => { | |||||
| sampleObject.zoomDataTimer = null; | |||||
| formatter: (value) => { | |||||
| if (sampleObject.zoomDataYTimer) { | |||||
| clearTimeout(sampleObject.zoomDataYTimer); | |||||
| sampleObject.zoomDataYTimer = setTimeout(() => { | |||||
| sampleObject.zoomDataYTimer = null; | |||||
| this.calIfOnePoint(sampleObject); | |||||
| }, 50); | }, 50); | ||||
| if (value < sampleObject.zoomData[0]) { | if (value < sampleObject.zoomData[0]) { | ||||
| sampleObject.zoomData[0] = value; | sampleObject.zoomData[0] = value; | ||||
| @@ -649,8 +671,8 @@ export default { | |||||
| } | } | ||||
| } else { | } else { | ||||
| sampleObject.zoomData = [value, value]; | sampleObject.zoomData = [value, value]; | ||||
| sampleObject.zoomDataTimer = setTimeout(() => { | |||||
| sampleObject.zoomDataTimer = null; | |||||
| sampleObject.zoomDataYTimer = setTimeout(() => { | |||||
| sampleObject.zoomDataYTimer = null; | |||||
| }, 50); | }, 50); | ||||
| } | } | ||||
| const symbol = Math.abs(value); | const symbol = Math.abs(value); | ||||
| @@ -889,70 +911,21 @@ export default { | |||||
| null, | null, | ||||
| ); | ); | ||||
| sampleObject.charObj.setOption(sampleObject.charData.charOption, true); | sampleObject.charObj.setOption(sampleObject.charData.charOption, true); | ||||
| this.$nextTick(() => { | |||||
| sampleObject.charObj.on('dataZoom', (params) => { | |||||
| this.dataZoomWatcher(params, sampleObject); | |||||
| }); | |||||
| sampleObject.charObj.on('restore', () => { | |||||
| this.restoreWatcher(sampleObject); | |||||
| }); | |||||
| }); | |||||
| } | |||||
| }, | |||||
| /** | |||||
| * The logic of reset chart option to keep showSymbol right | |||||
| * @param {Object} sampleObject Chart object | |||||
| */ | |||||
| resetOption(sampleObject) { | |||||
| const onePoint = 1; | |||||
| const series = sampleObject.charData.charOption.series; | |||||
| series.forEach((data) => { | |||||
| if (data.data.length > onePoint) { | |||||
| data.showSymbol = false; | |||||
| this.summaryInOnePoint[data.name] = false; | |||||
| } else { | |||||
| data.showSymbol = true; | |||||
| this.summaryInOnePoint[data.name] = true; | |||||
| } | |||||
| }); | |||||
| this.$nextTick(() => { | |||||
| sampleObject.charObj.setOption({ | |||||
| series: series, | |||||
| }); | |||||
| }); | |||||
| }, | |||||
| /** | |||||
| * The watcher of restore to keep showSymbol right | |||||
| * @param {Object} sampleObject Chart object | |||||
| */ | |||||
| restoreWatcher(sampleObject) { | |||||
| const selected = Object.keys(this.multiSelectedSummaryNames); | |||||
| if (!selected.length) { | |||||
| return; | |||||
| } | } | ||||
| this.resetOption(sampleObject); | |||||
| }, | }, | ||||
| /** | /** | ||||
| * The watcher of dataZoom to keep showSymbol right | |||||
| * @param {Object} params params | |||||
| * The logic of keep showSymbol right | |||||
| * @param {Object} sampleObject Chart object | * @param {Object} sampleObject Chart object | ||||
| */ | */ | ||||
| dataZoomWatcher(params, sampleObject) { | |||||
| const onePoint = 1; | |||||
| const selected = Object.keys(this.multiSelectedSummaryNames); | |||||
| if (!selected.length) { | |||||
| return; | |||||
| } | |||||
| const [xStart, xEnd] = [params.batch[0].startValue, params.batch[0].endValue]; | |||||
| const [yStart, yEnd] = [params.batch[1].startValue, params.batch[1].endValue]; | |||||
| if (typeof xStart === 'undefined') { | |||||
| // DataZoom back to the original state | |||||
| this.resetOption(sampleObject); | |||||
| } else { | |||||
| calIfOnePoint(sampleObject) { | |||||
| if (!sampleObject.dataZoomYTimer && !sampleObject.dataZoomXTimer) { | |||||
| // Format is finished | |||||
| const selected = Object.keys(this.multiSelectedSummaryNames); | |||||
| const [xStart, xEnd] = sampleObject.zoomDataX; | |||||
| const [yStart, yEnd] = sampleObject.zoomData; | |||||
| const series = sampleObject.charData.charOption.series; | const series = sampleObject.charData.charOption.series; | ||||
| const onePoint = 1; | |||||
| series.forEach((data) => { | series.forEach((data) => { | ||||
| if (selected.includes(data.name)) { | if (selected.includes(data.name)) { | ||||
| let count = 0; | let count = 0; | ||||
| @@ -969,7 +942,6 @@ export default { | |||||
| if (count === onePoint) { | if (count === onePoint) { | ||||
| if (!data.showSymbol) { | if (!data.showSymbol) { | ||||
| data.showSymbol = true; | data.showSymbol = true; | ||||
| this.summaryInOnePoint[data.name] = true; | |||||
| this.$nextTick(() => { | this.$nextTick(() => { | ||||
| sampleObject.charObj.setOption({ | sampleObject.charObj.setOption({ | ||||
| series: series, | series: series, | ||||
| @@ -979,7 +951,6 @@ export default { | |||||
| } else { | } else { | ||||
| if (data.showSymbol) { | if (data.showSymbol) { | ||||
| data.showSymbol = false; | data.showSymbol = false; | ||||
| this.summaryInOnePoint[data.name] = false; | |||||
| this.$nextTick(() => { | this.$nextTick(() => { | ||||
| sampleObject.charObj.setOption({ | sampleObject.charObj.setOption({ | ||||
| series: series, | series: series, | ||||
| @@ -1003,11 +974,39 @@ export default { | |||||
| * @return {Boolean} | * @return {Boolean} | ||||
| */ | */ | ||||
| calIfExist(xStart, xEnd, yStart, yEnd, xValue, yValue) { | calIfExist(xStart, xEnd, yStart, yEnd, xValue, yValue) { | ||||
| const newYStart = this.losePrecision(yStart, false); | |||||
| const newYEnd = this.losePrecision(yEnd, true); | |||||
| const xExist = xStart <= xValue && xValue <= xEnd; | const xExist = xStart <= xValue && xValue <= xEnd; | ||||
| const yEyist = yStart <= yValue && yValue <= yEnd; | |||||
| const yEyist = newYStart <= yValue && yValue <= newYEnd; | |||||
| return xExist && yEyist; | return xExist && yEyist; | ||||
| }, | }, | ||||
| /** | |||||
| * The logic of lose precision | |||||
| * @param {Number} number | |||||
| * @param {Boolean} ifCeil | |||||
| * @return {Number} | |||||
| */ | |||||
| losePrecision(number, ifCeil) { | |||||
| try { | |||||
| const [, decimal] = number.toString().split('.'); | |||||
| if (!decimal) { | |||||
| return number; | |||||
| } | |||||
| const decimalLength = decimal.length; | |||||
| // 10: use to move decimal point | |||||
| const param = Math.pow(10, decimalLength - 1); | |||||
| if (ifCeil) { | |||||
| number = Math.ceil(number * param); | |||||
| } else { | |||||
| number = Math.floor(number * param); | |||||
| } | |||||
| return number / param; | |||||
| } catch { | |||||
| return number; | |||||
| } | |||||
| }, | |||||
| /** | /** | ||||
| * Enabling/Disabling full screen | * Enabling/Disabling full screen | ||||
| * @param {Number} sampleIndex Chart subscript | * @param {Number} sampleIndex Chart subscript | ||||
| @@ -1091,8 +1090,6 @@ export default { | |||||
| } | } | ||||
| this.axisBenchChangeTimer = setTimeout(() => { | this.axisBenchChangeTimer = setTimeout(() => { | ||||
| // Update the horizontal benchmark of the default data | // Update the horizontal benchmark of the default data | ||||
| this.summaryInOnePoint = {}; | |||||
| const onePoint = 1; | |||||
| this.curPageArr.forEach((sampleObject) => { | this.curPageArr.forEach((sampleObject) => { | ||||
| if (sampleObject.charObj) { | if (sampleObject.charObj) { | ||||
| sampleObject.charData.oriData.forEach((originData, index) => { | sampleObject.charData.oriData.forEach((originData, index) => { | ||||
| @@ -1101,22 +1098,12 @@ export default { | |||||
| series[index * 2].data = this.formateSmoothData( | series[index * 2].data = this.formateSmoothData( | ||||
| sampleObject.charData.oriData[index].logData[this.curBenchX], | sampleObject.charData.oriData[index].logData[this.curBenchX], | ||||
| ); | ); | ||||
| if (series[index * 2].data.length === onePoint) { | |||||
| series[index * 2].showSymbol = true; | |||||
| } else { | |||||
| series[index * 2].showSymbol = false; | |||||
| } | |||||
| series[index * 2 + 1].data = | series[index * 2 + 1].data = | ||||
| sampleObject.charData.oriData[index].logData[this.curBenchX]; | sampleObject.charData.oriData[index].logData[this.curBenchX]; | ||||
| } else { | } else { | ||||
| series[index * 2].data = this.formateSmoothData( | series[index * 2].data = this.formateSmoothData( | ||||
| sampleObject.charData.oriData[index].valueData[this.curBenchX], | sampleObject.charData.oriData[index].valueData[this.curBenchX], | ||||
| ); | ); | ||||
| if (series[index * 2].data.length === onePoint) { | |||||
| series[index * 2].showSymbol = true; | |||||
| } else { | |||||
| series[index * 2].showSymbol = false; | |||||
| } | |||||
| series[index * 2 + 1].data = | series[index * 2 + 1].data = | ||||
| sampleObject.charData.oriData[index].valueData[ | sampleObject.charData.oriData[index].valueData[ | ||||
| this.curBenchX | this.curBenchX | ||||
| @@ -1264,7 +1251,6 @@ export default { | |||||
| this.originDataArr = []; | this.originDataArr = []; | ||||
| this.oriDataDictionaries = {}; | this.oriDataDictionaries = {}; | ||||
| this.curPageArr = []; | this.curPageArr = []; | ||||
| this.summaryInOnePoint = {}; | |||||
| }, | }, | ||||
| /** | /** | ||||
| @@ -1439,7 +1425,9 @@ export default { | |||||
| charOption: {}, | charOption: {}, | ||||
| }, | }, | ||||
| zoomData: [null, null], | zoomData: [null, null], | ||||
| zoomDataTimer: null, | |||||
| zoomDataX: [null, null], | |||||
| zoomDataYTimer: null, | |||||
| zoomDataXTimer: null, | |||||
| charObj: null, | charObj: null, | ||||
| }); | }); | ||||
| this.DomIdIndex++; | this.DomIdIndex++; | ||||
| @@ -1713,29 +1701,18 @@ export default { | |||||
| sampleObject.charData.charOption.toolbox.feature.myTool2.iconStyle.borderColor = | sampleObject.charData.charOption.toolbox.feature.myTool2.iconStyle.borderColor = | ||||
| '#666'; | '#666'; | ||||
| } | } | ||||
| const onePoint = 1; | |||||
| sampleObject.charData.oriData.forEach((originData, index) => { | sampleObject.charData.oriData.forEach((originData, index) => { | ||||
| const series = sampleObject.charData.charOption.series; | const series = sampleObject.charData.charOption.series; | ||||
| if (log) { | if (log) { | ||||
| series[index * 2].data = this.formateSmoothData( | series[index * 2].data = this.formateSmoothData( | ||||
| sampleObject.charData.oriData[index].logData[this.curBenchX], | sampleObject.charData.oriData[index].logData[this.curBenchX], | ||||
| ); | ); | ||||
| if (series[index * 2].data.length === onePoint) { | |||||
| series[index * 2].showSymbol = true; | |||||
| } else { | |||||
| series[index * 2].showSymbol = false; | |||||
| } | |||||
| series[index * 2 + 1].data = | series[index * 2 + 1].data = | ||||
| sampleObject.charData.oriData[index].logData[this.curBenchX]; | sampleObject.charData.oriData[index].logData[this.curBenchX]; | ||||
| } else { | } else { | ||||
| series[index * 2].data = this.formateSmoothData( | series[index * 2].data = this.formateSmoothData( | ||||
| sampleObject.charData.oriData[index].valueData[this.curBenchX], | sampleObject.charData.oriData[index].valueData[this.curBenchX], | ||||
| ); | ); | ||||
| if (series[index * 2].data.length === onePoint) { | |||||
| series[index * 2].showSymbol = true; | |||||
| } else { | |||||
| series[index * 2].showSymbol = false; | |||||
| } | |||||
| series[index * 2 + 1].data = | series[index * 2 + 1].data = | ||||
| sampleObject.charData.oriData[index].valueData[this.curBenchX]; | sampleObject.charData.oriData[index].valueData[this.curBenchX]; | ||||
| } | } | ||||
| @@ -593,7 +593,7 @@ export default { | |||||
| tag: sampleItem.tagName, | tag: sampleItem.tagName, | ||||
| detail: 'data', | detail: 'data', | ||||
| step: sampleItem.curStep, | step: sampleItem.curStep, | ||||
| dims: sampleItem.filterStr, | |||||
| dims: encodeURIComponent(sampleItem.filterStr), | |||||
| }; | }; | ||||
| sampleItem.curMartixShowSliderValue = sampleItem.sliderValue; | sampleItem.curMartixShowSliderValue = sampleItem.sliderValue; | ||||
| RequestService.getTensorsSample(params).then( | RequestService.getTensorsSample(params).then( | ||||
| @@ -1075,7 +1075,7 @@ export default { | |||||
| tag: this.tensorTag, | tag: this.tensorTag, | ||||
| detail: 'data', | detail: 'data', | ||||
| step: step, | step: step, | ||||
| dims: filterStr, | |||||
| dims: encodeURIComponent(filterStr), | |||||
| }; | }; | ||||
| RequestService.getTensorsSample(params).then( | RequestService.getTensorsSample(params).then( | ||||
| (res) => { | (res) => { | ||||
| @@ -1,4 +1,4 @@ | |||||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||||
| # Copyright 2020-2021 Huawei Technologies Co., Ltd | |||||
| # | # | ||||
| # Licensed under the Apache License, Version 2.0 (the "License"); | # Licensed under the Apache License, Version 2.0 (the "License"); | ||||
| # you may not use this file except in compliance with the License. | # you may not use this file except in compliance with the License. | ||||
| @@ -47,7 +47,7 @@ class AlexNet(nn.Cell): | |||||
| self.conv4 = conv(384, 384, 3, pad_mode="same") | self.conv4 = conv(384, 384, 3, pad_mode="same") | ||||
| self.conv5 = conv(384, 256, 3, pad_mode="same") | self.conv5 = conv(384, 256, 3, pad_mode="same") | ||||
| self.relu = nn.ReLU() | self.relu = nn.ReLU() | ||||
| self.max_pool2d = P.MaxPool(ksize=3, strides=2) | |||||
| self.max_pool2d = nn.MaxPool2d(kernel_size=3, stride=2, pad_mode="valid") | |||||
| self.flatten = nn.Flatten() | self.flatten = nn.Flatten() | ||||
| self.fc1 = fc_with_initialize(6*6*256, 4096) | self.fc1 = fc_with_initialize(6*6*256, 4096) | ||||
| self.fc2 = fc_with_initialize(4096, 4096) | self.fc2 = fc_with_initialize(4096, 4096) | ||||