icon温馨提醒 : 为提升您的浏览体验 , 推荐您使用Chrome浏览本网站。icon
icon

Some MindSpore pages use cookies to optimize brower services. To read MindSpore Privacy Policy click here

Decline

Allow

English
简体中文
English
Install
Select an environment and download an installation package.
Alternatively, create and deploy a model on ModelArts.
MindSpore官网banner
Obtaining Installation Commands
Version
1.0.0
0.7.0-beta
Hardware Platform
Ascend 910
GPU CUDA 10.1
CPU
Operating System
EulerOS-aarch64
EulerOS-x86
CentOS-aarch64
CentOS-x86
Ubuntu-aarch64
Ubuntu-x86
Windows-x64
Programming Language
Python 3.7.5
Installation Mode
Pip
Source
Commands
pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.0.0/MindSpore/ascend/euleros_aarch64/mindspore_ascend-1.0.0-cp37-cp37m-linux_aarch64.whl
# Refer to the following installation guide to configure the environment variables.

Installation Guide

MindSpore Installation Guide

This document describes how to quickly install MindSpore in an Ascend AI processor environment.

Environment Requirements

Hardware Requirements

  • Ascend 910 AI processor

    • Reserve at least 32 GB memory for each card.

System Requirements and Software Dependencies

VersionOperating SystemExecutable File Installation DependenciesSource Code Compilation and Installation Dependencies
MindSpore 1.0.0- Ubuntu 18.04 aarch64
- Ubuntu 18.04 x86_64
- CentOS 7.6 aarch64
- CentOS 7.6 x86_64
- EulerOS 2.8 aarch64
- EulerOS 2.5 x86_64
- Python 3.7.5
- Ascend 910 AI processor
  software package(Version:
  Atlas Data Center Solution
  V100R020C10T500:
  A800-9000 1.0T112,
  CANN V100R020C10T100)
- gmp 6.1.2
- For details about other dependency items, see requirements.txt.
Compilation dependencies:
- Python 3.7.5
- Ascend 910 AI processor
  software package(Version:
  Atlas Data Center Solution
  V100R020C10T500:
  A800-9000 1.0T112,
  CANN V100R020C10T100)
- wheel >= 0.32.0
- GCC 7.3.0
- CMake >= 3.14.1
- patch >= 2.5
- gmp 6.1.2
Installation dependencies:
same as the executable file installation dependencies.
  • Confirm that the current user has the right to access the installation path /usr/local/Ascendof Ascend 910 AI processor software package(Version:Atlas Data Center Solution V100R020C10T500: A800-9000 1.0T112, CANN V100R020C10T100). If not, the root user needs to add the current user to the user group where /usr/local/Ascend is located. For the specific configuration, please refer to the software package instruction document.
  • GCC 7.3.0 can be installed by using apt command.
  • When the network is connected, dependency items in the requirements.txt file are automatically downloaded during .whl package installation. In other cases, you need to manually install dependency items.

(Optional) Installing Conda

  1. Download the Conda installation package from the following path:

  2. Create and activate the Python environment.

    conda create -n {your_env_name} python=3.7.5
    conda activate {your_env_name}
    

Conda is a powerful Python environment management tool. Beginers are adviced to check related information on the Internet.

Configuring software package Dependencies

  • Install the .whl package provided in Ascend 910 AI processor software package(Version:Atlas Data Center Solution V100R020C10T500: A800-9000 1.0T112, CANN V100R020C10T100). The .whl package is released with the software package. After software package is upgraded, reinstall the .whl package.

    pip install /usr/local/Ascend/fwkacllib/lib64/topi-{version}-py3-none-any.whl
    pip install /usr/local/Ascend/fwkacllib/lib64/te-{version}-py3-none-any.whl
    pip install /usr/local/Ascend/fwkacllib/lib64/hccl-{version}-py3-none-any.whl
    

Installation Guide

Installing Using Executable Files

  • Download the .whl package from the MindSpore website. It is recommended to perform SHA-256 integrity verification first and run the following command to install MindSpore:

    pip install mindspore_ascend-{version}-cp37-cp37m-linux_{arch}.whl
    

Installing Using the Source Code

The compilation and installation must be performed on the Ascend 910 AI processor environment.

  1. Download the source code from the code repository.

    git clone https://gitee.com/mindspore/mindspore.git -b r1.0
    
  2. Run the following command in the root directory of the source code to compile MindSpore:

    bash build.sh -e ascend
    
    • Before running the preceding command, ensure that the paths where the executable files cmake and patch store have been added to the environment variable PATH.
    • In the build.sh script, the git clone command will be executed to obtain the code in the third-party dependency database. Ensure that the network settings of Git are correct.
    • In the build.sh script, the default number of compilation threads is 8. If the compiler performance is poor, compilation errors may occur. You can add -j{Number of threads} in to script to reduce the number of threads. For example, bash build.sh -e ascend -j4.
  3. Run the following command to install MindSpore:

    chmod +x build/package/mindspore_ascend-{version}-cp37-cp37m-linux_{arch}.whl
    pip install build/package/mindspore_ascend-{version}-cp37-cp37m-linux_{arch}.whl
    

Configuring Environment Variables

  • If Ascend 910 AI processor software is installed in a non-default path, after MindSpore is installed, export runtime-related environment variables.

    # control log level. 0-DEBUG, 1-INFO, 2-WARNING, 3-ERROR, default level is WARNING.
    export GLOG_v=2
    
    # Set Soc Version, if this environment variable is not set, the program will read the default value from the system.
    export SOC_VERSION=Ascend910
    
    # Conda environmental options
    LOCAL_ASCEND=/usr/local/Ascend # the root directory of run package
    
    # lib libraries that the run package depends on
    export LD_LIBRARY_PATH=${LOCAL_ASCEND}/add-ons/:${LOCAL_ASCEND}/ascend-toolkit/latest/fwkacllib/lib64:${LOCAL_ASCEND}/driver/lib64:${LD_LIBRARY_PATH}
    
    # Environment variables that must be configured
    export TBE_IMPL_PATH=${LOCAL_ASCEND}/ascend-toolkit/latest/opp/op_impl/built-in/ai_core/tbe            # TBE operator implementation tool path
    export ASCEND_OPP_PATH=${LOCAL_ASCEND}/ascend-toolkit/latest/opp                                       # OPP path
    export PATH=${LOCAL_ASCEND}/ascend-toolkit/latest/fwkacllib/ccec_compiler/bin/:${PATH}                 # TBE operator compilation tool path
    export PYTHONPATH=${TBE_IMPL_PATH}:${PYTHONPATH}                                                # Python library that TBE implementation depends on
    
    

Installation Verification

  • After configuring the environment variables, execute the following Python script:

    import numpy as np
    from mindspore import Tensor
    from mindspore.ops import functional as F
    import mindspore.context as context
    
    context.set_context(device_target="Ascend")
    x = Tensor(np.ones([1,3,3,4]).astype(np.float32))
    y = Tensor(np.ones([1,3,3,4]).astype(np.float32))
    print(F.tensor_add(x, y))
    
  • The outputs should be the same as:

    [[[ 2.  2.  2.  2.],
      [ 2.  2.  2.  2.],
      [ 2.  2.  2.  2.]],
    
     [[ 2.  2.  2.  2.],
      [ 2.  2.  2.  2.],
      [ 2.  2.  2.  2.]],
    
     [[ 2.  2.  2.  2.],
      [ 2.  2.  2.  2.],
      [ 2.  2.  2.  2.]]]
    

Installing MindInsight

If you need to analyze information such as model scalars, graphs, and model traceback, you can install MindInsight.

Environment Requirements

System Requirements and Software Dependencies

VersionOperating SystemExecutable File Installation DependenciesSource Code Compilation and Installation Dependencies
MindInsight 1.0.0- Ubuntu 18.04 aarch64
- Ubuntu 18.04 x86_64
- CentOS 7.6 aarch64
- CentOS 7.6 x86_64
- EulerOS 2.8 aarch64
- EulerOS 2.5 x86_64
- Python 3.7.5
- MindSpore 1.0.0
- For details about other dependency items, see requirements.txt.
Compilation dependencies:
- Python 3.7.5
- CMake >= 3.14.1
- GCC 7.3.0
- node.js >= 10.19.0
- wheel >= 0.32.0
- pybind11 >= 2.4.3
Installation dependencies:
same as the executable file installation dependencies.
  • When the network is connected, dependency items in the requirements.txt file are automatically downloaded during .whl package installation. In other cases, you need to manually install dependency items.

Installation Guide

Installing Using Executable Files

  1. Download the .whl package from the MindSpore website. It is recommended to perform SHA-256 integrity verification first and run the following command to install MindInsight:

    pip install mindinsight-{version}-cp37-cp37m-linux_{arch}.whl
    
  2. Run the following command. If web address: http://127.0.0.1:8080 is displayed, the installation is successful.

    mindinsight start
    

Installing Using the Source Code

  1. Download the source code from the code repository.

    git clone https://gitee.com/mindspore/mindinsight.git -b r1.0
    

    You are not supposed to obtain the source code from the zip package downloaded from the repository homepage.

  2. Install MindInsight by using either of the following installation methods:

    (1) Access the root directory of the source code and run the following installation command:

    cd mindinsight
    pip install -r requirements.txt
    python setup.py install
    

    (2) Create a .whl package to install MindInsight.

    Access the root directory of the source code. First run the MindInsight compilation script under the build directory of the source code. Then run the command to install the .whl package generated in the output directory of the source code.

    cd mindinsight
    bash build/build.sh
    pip install output/mindinsight-{version}-cp37-cp37m-linux_{arch}.whl
    
  3. Run the following command. If web address: http://127.0.0.1:8080 is displayed, the installation is successful.

    mindinsight start
    

Installing MindArmour

If you need to conduct AI model security research or enhance the security of the model in you applications, you can install MindArmour.

Environment Requirements

System Requirements and Software Dependencies

VersionOperating SystemExecutable File Installation DependenciesSource Code Compilation and Installation Dependencies
MindArmour 1.0.0- Ubuntu 18.04 aarch64
- Ubuntu 18.04 x86_64
- CentOS 7.6 aarch64
- CentOS 7.6 x86_64
- EulerOS 2.8 aarch64
- EulerOS 2.5 x86_64
- Python 3.7.5
- MindSpore 1.0.0
- For details about other dependency items, see setup.py.
Same as the executable file installation dependencies.
  • When the network is connected, dependency items in the setup.py file are automatically downloaded during .whl package installation. In other cases, you need to manually install dependency items.

Installation Guide

Installing Using Executable Files

  1. Download the .whl package from the MindSpore website. It is recommended to perform SHA-256 integrity verification first and run the following command to install MindArmour:

    pip install mindarmour-{version}-cp37-cp37m-linux_{arch}.whl
    
  2. Run the following command. If no loading error message such as No module named 'mindarmour' is displayed, the installation is successful.

    python -c 'import mindarmour'
    

Installing Using the Source Code

  1. Download the source code from the code repository.

    git clone https://gitee.com/mindspore/mindarmour.git -b r1.0
    
  2. Run the following command in the root directory of the source code to compile and install MindArmour:

    cd mindarmour
    python setup.py install
    
  3. Run the following command. If no loading error message such as No module named 'mindarmour' is displayed, the installation is successful.

    python -c 'import mindarmour'
    

Installing MindSpore Hub

If you need to access and experience MindSpore pre-trained models quickly, you can install MindSpore Hub.

For details about install steps, see MindSpore Hub.

Accessing ModelArts

ModelArts helps users quickly create and deploy models and manage the entire AI workflow. Click ModelArts to use MindSpore.