MindInsight provides MindSpore with easy-to-use tuning and debugging capabilities. During the training process, data such as scalars, tensors, images, calculation graphs, model hyperparameters, and training time can be recorded into files and viewed and analyzed through the MindInsight visualization page.
The hardware platform is Ascend or GPU.
Confirm that Python 3.7.5 is installed.
MindInsight and MindSpore need to be consistent.
If you use source code to compile and install, you also need to confirm that the following dependencies are installed.
Confirm to install CMake 3.14.1 and above.
Confirm installation of GCC 7.3.0.
Confirm to install node.js 10.19.0 and above.
Confirm the installation of wheel 0.32.0 and above.
Confirm to install pybind11 2.4.3 and above.
For other dependencies, see requirements.txt.
You can use pip installation or source code compilation and installation.
Install on PyPI:
pip install mindinsightInstall customization:
pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/{version}/MindInsight/any/mindinsight-{version}-py3-none-any.whl --trusted-host ms- release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simpleWhen connected to the Internet, the dependencies of the MindInsight installation package will be automatically downloaded when installing the whl package (see requirements.txt for details on dependencies). In other cases, you need to install it yourself.
{version} represents the MindInsight number. For example, when downloading MindInsight 1.3.0, {version} should be written as 1.3.0.
MindInsight supports Linux distribution systems using x86 64-bit or ARM 64-bit architecture.
Download the source code from the code repository
git clone https://gitee.com/mindspore/mindinsight.gitCompile and install MindInsight
You can choose any of the following installation methods
1. Execute the following command in the source code root directory.
cd mindinsightpip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simplepython setup.py install2. Build the whl package and install it.
Enter the root directory of the source code, first execute the MindInsight compilation script in the build directory, and then execute the command to install the whl package generated in the output directory.
cd mindinsightbash build/build.shpip install output/mindinsight-{version}-py3-none-any.whl -i https://pypi.tuna.tsinghua.edu.cn/simpleVerify successful installation
Execute the following command
mindinsight start [--port PORT]If the following prompt appears, the installation is successful
Web address: http://127.0.0.1:8080service start state: success
Before using MindInsight, you need to record the data during the training process. When starting MindInsight, specify the location of the saved data. After the startup is successful, you can view the data through the visualization page. The following will briefly introduce recording training process data, and starting and stopping the MindInsight service.
SummaryCollector is an interface provided by MindSpore to quickly and easily collect some common information. The information collected includes calculation graphs, loss values, learning rates, parameter weights, etc. The following is an example of using SummaryCollector for data collection, in which the directory where the data is stored is specified as ./summary_dir.
...from mindspore import SummaryCollectorssummary_collector = SummaryCollector(summary_dir='./summary_dir')model.train(epoch=1, ds_train, callbacks=[summary_collector])
For more methods of recording visual data, please click to view the MindInsight usage tutorial.
After collecting the data, specify the directory to store the data when starting MindInsight.
mindinsight start --summary-base-dir ./summary_dir [--port PORT]
After successful startup, access http://127.0.0.1:8080 through the browser to view the visualization page.
Command to stop MindInsight service
mindinsight stop [--port PORT]