0

华为开源自研AI框架昇思MindSpore CPU-Ubuntu版本 Pip自动安装教程

 1 year ago
source link: https://blog.51cto.com/yeatsliao/5979054
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.




本教程是在CPU-Ubuntu上安装MindSpore1.8.1

如果你对MindSpore感兴趣,可以关注 昇思MindSpore社区

MindSpore旨在提供端边云全场景的AI框架。MindSpore可部署于端、边、云不同的硬件环境,满足不同环境的差异化需求,如支持端侧的轻量化部署,支持云侧丰富的训练功能如自动微分、混合精度、模型易用编程等。

华为开源自研AI框架昇思MindSpore CPU-Ubuntu版本 Pip自动安装教程_bash

二、获取命令

1.进入MindSpore官网

进入昇思MindSpore官网,点击上方的安装

详见: https://www.mindspore.cn/

华为开源自研AI框架昇思MindSpore CPU-Ubuntu版本 Pip自动安装教程_bash_02

2.选择安装版本

  • 版本 1.8.1
  • 硬件平台 CPU
  • 操作系统 Linux-aarch64
  • 编程语言 Python 3.8
  • 安装方式 Pip
    华为开源自研AI框架昇思MindSpore CPU-Ubuntu版本 Pip自动安装教程_bash_03

3.获取命令

pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.8.1/MindSpore/cpu/aarch64/mindspore-1.8.1-cp38-cp38-linux_aarch64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple
# 注意参考下方安装指南,确保安装依赖以及环境变量配置正确
华为开源自研AI框架昇思MindSpore CPU-Ubuntu版本 Pip自动安装教程_插入图片_04

三、自动安装

1.确保为Ubuntu系统

lsb_release -a
华为开源自研AI框架昇思MindSpore CPU-Ubuntu版本 Pip自动安装教程_插入图片_05

2.下载自动安装脚本

自动安装脚本需要更改软件源配置以及通过APT安装依赖,所以需要申请root权限。使用以下命令获取自动安装脚本并执行。

wget https://gitee.com/mindspore/mindspore/raw/r1.8/scripts/install/ubuntu-cpu-pip.sh
华为开源自研AI框架昇思MindSpore CPU-Ubuntu版本 Pip自动安装教程_bash_06

3.执行自动安装脚本

该脚本将会更改软件源配置为华为云源、安装相关依赖项(如GCC,gmp ),通过APT安装Python3和Pip3、通过Pip安装MindSpore。会自动验证并输出安装版本号。

MINDSPORE_VERSION=1.8.1 bash ./ubuntu-cpu-pip.sh
华为开源自研AI框架昇思MindSpore CPU-Ubuntu版本 Pip自动安装教程_bash_07

4.验证安装

自动安装后使用Source命令更新环境变量

source ~/.bashrc

验证是否成功安装

python -c "import mindspore;mindspore.run_check()"

华为开源自研AI框架昇思MindSpore CPU-Ubuntu版本 Pip自动安装教程_bash_08

如果输出以下则说明MindSpore安装成功了

华为开源自研AI框架昇思MindSpore CPU-Ubuntu版本 Pip自动安装教程_bash_09


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK