diff --git a/install/mindspore_ascend_install_conda.md b/install/mindspore_ascend_install_conda.md index 272efdd6c3fc3bfdb5cacb4ace1b375f8721ecf1..da8c60e73165cb8395c6daa62b33ba259328249b 100644 --- a/install/mindspore_ascend_install_conda.md +++ b/install/mindspore_ascend_install_conda.md @@ -106,6 +106,23 @@ export PYTHONPATH=${TBE_IMPL_PATH}:${PYTHONPATH} ## 验证是否成功安装 +方法一: + +```bash +python -c "import mindspore;mindspore.check()" +``` + +如果输出: + +```text +mindspore version: 版本号 +The result of multiplication calculation is correct, mindshare installation successful! +``` + +说明MindSpore安装成功了。 + +方法二: + ```python import numpy as np from mindspore import Tensor diff --git a/install/mindspore_ascend_install_docker.md b/install/mindspore_ascend_install_docker.md index 9917e8bf6ab439b279a542fbb348ea448458a31d..716143f9dfec29edaf092d2d762e03cfee523a4a 100644 --- a/install/mindspore_ascend_install_docker.md +++ b/install/mindspore_ascend_install_docker.md @@ -84,6 +84,23 @@ docker run -it -v /usr/local/Ascend/driver:/usr/local/Ascend/driver \ 按照上述步骤进入MindSpore容器后,测试Docker容器是否正常工作,请运行下面的Python代码并检查输出: +方法一: + +```bash +python -c "import mindspore;mindspore.check()" +``` + +如果输出: + +```text +mindspore version: 版本号 +The result of multiplication calculation is correct, mindshare installation successful! +``` + +至此,你已经成功通过Docker方式安装了MindSpore Ascend 910版本。 + +方法二: + ```python import numpy as np from mindspore import Tensor diff --git a/install/mindspore_ascend_install_docker_en.md b/install/mindspore_ascend_install_docker_en.md index f0247399108d04aa4df71fcc35e623d30b9febc5..6a72ca835ebb5f4d6d5300c95866a16174ed8127 100644 --- a/install/mindspore_ascend_install_docker_en.md +++ b/install/mindspore_ascend_install_docker_en.md @@ -84,6 +84,23 @@ of which, After entering the MindSpore container according to the above steps, to test whether the Docker container is working properly, please run the following Python code and check the output: +i: + +```bash +python -c "import mindspore;mindspore.check()" +``` + +The outputs should be the same as: + +```text +mindspore version: __version__ +The result of multiplication calculation is correct, mindshare installation successful! +``` + +It means MindSpore has been installed by docker successfully. + +ii: + ```python import numpy as np from mindspore import Tensor diff --git a/install/mindspore_ascend_install_pip.md b/install/mindspore_ascend_install_pip.md index d3331cc969e5aab6001f2fdbed532d5c392dbad5..4a2aaf1525d5bac29ebb13bb6e831be5011f1c0c 100644 --- a/install/mindspore_ascend_install_pip.md +++ b/install/mindspore_ascend_install_pip.md @@ -81,6 +81,23 @@ export PYTHONPATH=${TBE_IMPL_PATH}:${PYTHONPATH} ## 验证是否成功安装 +方法一: + +```bash +python -c "import mindspore;mindspore.check()" +``` + +如果输出: + +```text +mindspore version: 版本号 +The result of multiplication calculation is correct, mindshare installation successful! +``` + +说明MindSpore安装成功了。 + +方法二: + ```python import numpy as np from mindspore import Tensor diff --git a/install/mindspore_ascend_install_pip_en.md b/install/mindspore_ascend_install_pip_en.md index 1f205a3c40fc3a76fb171828f7238070bd9a48f2..1fa3c378542c2b6bf750d7998840e2c83a01aa49 100644 --- a/install/mindspore_ascend_install_pip_en.md +++ b/install/mindspore_ascend_install_pip_en.md @@ -82,35 +82,54 @@ Of which, ## Installation Verification +i: + - After configuring the environment variables, execute the following Python script: - ```python - import numpy as np - from mindspore import Tensor - import mindspore.ops as ops - import mindspore.context as context +```bash +python -c "import mindspore;mindspore.check()" +``` - 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(ops.add(x, y)) - ``` +- The outputs should be the same as: + +```text +mindspore version: __version__ +The result of multiplication calculation is correct, mindshare installation successful! +``` + +It means MindSpore has been installed successfully. + +ii: + +- After configuring the environment variables, execute the following Python script: + +```python +import numpy as np +from mindspore import Tensor +import mindspore.ops as ops +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(ops.add(x, y)) +``` - The outputs should be the same as: - ```text - [[[ 2. 2. 2. 2.], - [ 2. 2. 2. 2.], - [ 2. 2. 2. 2.]], +```text +[[[ 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.]], - [[ 2. 2. 2. 2.], - [ 2. 2. 2. 2.], - [ 2. 2. 2. 2.]]] - ``` +[[ 2. 2. 2. 2.], +[ 2. 2. 2. 2.], +[ 2. 2. 2. 2.]]] +``` It means MindSpore has been installed successfully. diff --git a/install/mindspore_ascend_install_source.md b/install/mindspore_ascend_install_source.md index 4ea9c3481d7081123b543b848f9fc4a690c465b3..250939737ef6dcc9adacee9fa876c224349e6407 100644 --- a/install/mindspore_ascend_install_source.md +++ b/install/mindspore_ascend_install_source.md @@ -131,6 +131,23 @@ export PYTHONPATH=${TBE_IMPL_PATH}:${PYTHONPATH} ## 验证是否成功安装 +方法一: + +```bash +python -c "import mindspore;mindspore.check()" +``` + +如果输出: + +```text +mindspore version: 版本号 +The result of multiplication calculation is correct, mindshare installation successful! +``` + +说明MindSpore安装成功了。 + +方法二: + ```python import numpy as np from mindspore import Tensor diff --git a/install/mindspore_ascend_install_source_en.md b/install/mindspore_ascend_install_source_en.md index 2ba8d5309cd1de94eba1f4355ba8ccd79dd821bd..b29da7a794a538f7122676d9850e512eca7bddcb 100644 --- a/install/mindspore_ascend_install_source_en.md +++ b/install/mindspore_ascend_install_source_en.md @@ -135,6 +135,23 @@ Of which, ## Installation Verification +i: + +```bash +python -c "import mindspore;mindspore.check()" +``` + +- The outputs should be the same as: + +```text +mindspore version: __version__ +The result of multiplication calculation is correct, mindshare installation successful! +``` + +It means MindSpore has been installed successfully. + +ii: + ```python import numpy as np from mindspore import Tensor diff --git a/install/mindspore_cpu_install_conda.md b/install/mindspore_cpu_install_conda.md index 046094cd797166d977a0caa98a6c53282b1518e2..cf1a34111d1d2663f8c2ab029aa6777c6c935395 100644 --- a/install/mindspore_cpu_install_conda.md +++ b/install/mindspore_cpu_install_conda.md @@ -68,10 +68,17 @@ pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/{version}/MindSp ## 验证安装是否成功 ```bash -python -c "import mindspore;print(mindspore.__version__)" +python -c "import mindspore;mindspore.check()" ``` -如果输出MindSpore版本号,说明MindSpore安装成功了,如果输出`No module named 'mindspore'`说明未成功安装。 +如果输出: + +```text +mindspore version: 版本号 +The result of multiplication calculation is correct, mindshare installation successful! +``` + +说明MindSpore安装成功了。 ## 升级MindSpore版本 diff --git a/install/mindspore_cpu_install_docker.md b/install/mindspore_cpu_install_docker.md index 551c576604b9cb011144a828a5492f3f90154962..ccdb621776d45d46f40f45634fbd69f8ee7bea77 100644 --- a/install/mindspore_cpu_install_docker.md +++ b/install/mindspore_cpu_install_docker.md @@ -62,37 +62,54 @@ docker run -it swr.cn-south-1.myhuaweicloud.com/mindspore/mindspore-cpu:{tag} /b - 如果你安装的是指定版本`x.y.z`的容器。 按照上述步骤进入MindSpore容器后,测试Docker是否正常工作,请运行下面的Python代码并检查输出: + +方法一: + +```bash +python -c "import mindspore;mindspore.check()" +``` + +如果输出: + +```text +mindspore version: 版本号 +The result of multiplication calculation is correct, mindshare installation successful! +``` - ```python - import numpy as np - import mindspore.context as context - import mindspore.ops as ops - from mindspore import Tensor +至此,你已经成功通过Docker方式安装了MindSpore CPU版本。 + +方法二: - context.set_context(mode=context.PYNATIVE_MODE, device_target="CPU") +```python +import numpy as np +import mindspore.context as context +import mindspore.ops as ops +from mindspore import Tensor - x = Tensor(np.ones([1,3,3,4]).astype(np.float32)) - y = Tensor(np.ones([1,3,3,4]).astype(np.float32)) - print(ops.add(x, y)) - ``` +context.set_context(mode=context.PYNATIVE_MODE, device_target="CPU") + +x = Tensor(np.ones([1,3,3,4]).astype(np.float32)) +y = Tensor(np.ones([1,3,3,4]).astype(np.float32)) +print(ops.add(x, y)) +``` 代码成功运行时会输出: - ```text - [[[ 2. 2. 2. 2.], - [ 2. 2. 2. 2.], - [ 2. 2. 2. 2.]], +```text +[[[ 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.]], - [[ 2. 2. 2. 2.], - [ 2. 2. 2. 2.], - [ 2. 2. 2. 2.]]] - ``` +[[ 2. 2. 2. 2.], +[ 2. 2. 2. 2.], +[ 2. 2. 2. 2.]]] +``` - 至此,你已经成功通过Docker方式安装了MindSpore CPU版本。 +至此,你已经成功通过Docker方式安装了MindSpore CPU版本。 - 如果你安装的是`runtime`标签的容器,需要自行安装MindSpore。 diff --git a/install/mindspore_cpu_install_docker_en.md b/install/mindspore_cpu_install_docker_en.md index 68abe6c42297d8482b723c3686be97b91cd22918..fee6d468ac3bfd9ee325d53a25768e9e29f3996d 100644 --- a/install/mindspore_cpu_install_docker_en.md +++ b/install/mindspore_cpu_install_docker_en.md @@ -63,36 +63,53 @@ of which, After entering the MindSpore container according to the above steps, to test whether the Docker container is working properly, please run the following Python code and check the output: - ```python - import numpy as np - import mindspore.context as context - import mindspore.ops as ops - from mindspore import Tensor +i: + +```bash +python -c "import mindspore;mindspore.check()" +``` + +- The outputs should be the same as: + +```text +mindspore version: __version__ +The result of multiplication calculation is correct, mindshare installation successful! +``` + +It means MindSpore has been installed by docker successfully. - context.set_context(mode=context.PYNATIVE_MODE, device_target="CPU") +ii: - x = Tensor(np.ones([1,3,3,4]).astype(np.float32)) - y = Tensor(np.ones([1,3,3,4]).astype(np.float32)) - print(ops.add(x, y)) - ``` +```python +import numpy as np +import mindspore.context as context +import mindspore.ops as ops +from mindspore import Tensor - The outputs should be the same as: +context.set_context(mode=context.PYNATIVE_MODE, device_target="CPU") - ```text - [[[ 2. 2. 2. 2.], - [ 2. 2. 2. 2.], - [ 2. 2. 2. 2.]], +x = Tensor(np.ones([1,3,3,4]).astype(np.float32)) +y = Tensor(np.ones([1,3,3,4]).astype(np.float32)) +print(ops.add(x, y)) +``` - [[ 2. 2. 2. 2.], - [ 2. 2. 2. 2.], - [ 2. 2. 2. 2.]], +The outputs should be the same as: - [[ 2. 2. 2. 2.], - [ 2. 2. 2. 2.], - [ 2. 2. 2. 2.]]] - ``` +```text +[[[ 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.]]] +``` - It means MindSpore has been installed by docker successfully. +It means MindSpore has been installed by docker successfully. - If you install a container with the label of `runtime`, you need to install MindSpore yourself. diff --git a/install/mindspore_cpu_install_pip.md b/install/mindspore_cpu_install_pip.md index d362aea53f27ee13f466e22394f3597519dd32b9..7142a5a4c3d5998e582f53367d0652e230e275be 100644 --- a/install/mindspore_cpu_install_pip.md +++ b/install/mindspore_cpu_install_pip.md @@ -42,10 +42,17 @@ pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/{version}/MindSp ## 查询安装是否成功 ```bash -python -c "import mindspore;print(mindspore.__version__)" +python -c "import mindspore;mindspore.check()" ``` -如果输出MindSpore版本号,说明MindSpore安装成功了,如果输出`No module named 'mindspore'`说明未成功安装。 +如果输出: + +```text +mindspore version: 版本号 +The result of multiplication calculation is correct, mindshare installation successful! +``` + +说明MindSpore安装成功了。 ## 升级MindSpore版本 diff --git a/install/mindspore_cpu_install_pip_en.md b/install/mindspore_cpu_install_pip_en.md index 77c1c2636e1e5b6a937aa3e6d0e864da64c3e7c8..928cb63645ddaa3e95bcf31ced5a53ce6bb0376f 100644 --- a/install/mindspore_cpu_install_pip_en.md +++ b/install/mindspore_cpu_install_pip_en.md @@ -42,10 +42,17 @@ Of which, ## Installation Verification ```bash -python -c "import mindspore;print(mindspore.__version__)" +python -c "import mindspore;mindspore.check()" ``` -If the MindSpore version number is displayed, it means that MindSpore is installed successfully, and if the output is `No module named 'mindspore'`, it means that the installation was not successful. +The outputs should be the same as: + +```text +mindspore version: __version__ +The result of multiplication calculation is correct, mindshare installation successful! +``` + +It means MindSpore has been installed successfully. ## Version Update diff --git a/install/mindspore_cpu_install_source.md b/install/mindspore_cpu_install_source.md index 48d44923e95dd918a2c858b383876ff6676df712..b26b6b519162823d20a46bb274f15980b87c49ee 100644 --- a/install/mindspore_cpu_install_source.md +++ b/install/mindspore_cpu_install_source.md @@ -80,10 +80,17 @@ pip install build/package/mindspore-{version}-cp37-cp37m-linux_{arch}.whl -i htt ## 验证安装是否成功 ```bash -python -c 'import mindspore;print(mindspore.__version__)' +python -c "import mindspore;mindspore.check()" ``` -如果输出MindSpore版本号,说明MindSpore安装成功了,如果输出`No module named 'mindspore'`说明未安装成功。 +如果输出: + +```text +mindspore version: 版本号 +The result of multiplication calculation is correct, mindshare installation successful! +``` + +说明MindSpore安装成功了。 ## 升级MindSpore版本 diff --git a/install/mindspore_cpu_install_source_en.md b/install/mindspore_cpu_install_source_en.md index f4bd70cbd559a2130628ef77ba5b94ec8c913b20..c3fcc9e88d7d0574a1bed27e443184e440f7c240 100644 --- a/install/mindspore_cpu_install_source_en.md +++ b/install/mindspore_cpu_install_source_en.md @@ -79,10 +79,17 @@ Of which, ## Installation Verification ```bash -python -c 'import mindspore;print(mindspore.__version__)' +python -c "import mindspore;mindspore.check()" ``` -If the MindSpore version number is displayed, it means that MindSpore is installed successfully, and if the output is `No module named'mindspore'`, it means that the installation was not successful. +The outputs should be the same as: + +```text +mindspore version: __version__ +The result of multiplication calculation is correct, mindshare installation successful! +``` + +It means MindSpore has been installed successfully. ## Version Update diff --git a/install/mindspore_cpu_macos_install_conda.md b/install/mindspore_cpu_macos_install_conda.md index f193bce42814bbaf6b77c0b20bfb6c2388705f6a..37c2d1298739d34751cf10b4022c94044f2ba846 100644 --- a/install/mindspore_cpu_macos_install_conda.md +++ b/install/mindspore_cpu_macos_install_conda.md @@ -60,10 +60,17 @@ conda activate mindspore ## 验证是否安装成功 ```bash -python -c "import mindspore;mindspore.__version__" +python -c "import mindspore;mindspore.check()" ``` -如果输出MindSpore版本号,说明MindSpore安装成功了,如果输出`No module named 'mindspore'`说明未安装成功。 +如果输出: + +```text +mindspore version: 版本号 +The result of multiplication calculation is correct, mindshare installation successful! +``` + +说明MindSpore安装成功了。 ## 升级MindSpore版本 diff --git a/install/mindspore_cpu_macos_install_pip.md b/install/mindspore_cpu_macos_install_pip.md index d9d4757c0944b65d9a8a8696d7091a77d7ed4e81..327c712365eb9750ca183db46b0e8cb28ea9e527 100644 --- a/install/mindspore_cpu_macos_install_pip.md +++ b/install/mindspore_cpu_macos_install_pip.md @@ -36,10 +36,17 @@ ## 验证是否安装成功 ```bash -python -c "import mindspore;print(mindspore.__version__)" +python -c "import mindspore;mindspore.check()" ``` -如果输出MindSpore版本号,说明MindSpore安装成功了,如果输出`No module named 'mindspore'`说明未安装成功。 +如果输出: + +```text +mindspore version: 版本号 +The result of multiplication calculation is correct, mindshare installation successful! +``` + +说明MindSpore安装成功了。 ## 升级MindSpore版本 diff --git a/install/mindspore_cpu_macos_install_pip_en.md b/install/mindspore_cpu_macos_install_pip_en.md index 8ac0abe17b37bad933f56d59f11442837c420f77..ca2376b6cc71bdecc68dc4b12d9d12ac49968b61 100644 --- a/install/mindspore_cpu_macos_install_pip_en.md +++ b/install/mindspore_cpu_macos_install_pip_en.md @@ -35,10 +35,17 @@ Of which, ## Installation Verification ```bash -python -c "import mindspore;print(mindspore.__version__)" +python -c "import mindspore;mindspore.check()" ``` -If the MindSpore version number is displayed, it means that MindSpore is installed successfully, and if the output is `No module named 'mindspore'`, it means that the installation was not successful. +The outputs should be the same as: + +```text +mindspore version: __version__ +The result of multiplication calculation is correct, mindshare installation successful! +``` + +It means MindSpore has been installed successfully. ## Version Update diff --git a/install/mindspore_cpu_macos_install_source.md b/install/mindspore_cpu_macos_install_source.md index b9a4f0e5c1b3b37105d986c8bf66e5f65f7e2635..eaf209415bd330c0b87f2ac11848a1083b3c86c2 100644 --- a/install/mindspore_cpu_macos_install_source.md +++ b/install/mindspore_cpu_macos_install_source.md @@ -62,10 +62,17 @@ pip install build/package/mindspore-{version}-py37-none-any.whl -i https://pypi. ## 验证是否安装成功 ```bash -python -c "import mindspore;print(mindspore.__version__)" +python -c "import mindspore;mindspore.check()" ``` -如果输出MindSpore版本号,说明MindSpore安装成功了,如果输出`No module named 'mindspore'`说明未安装成功。 +如果输出: + +```text +mindspore version: 版本号 +The result of multiplication calculation is correct, mindshare installation successful! +``` + +说明MindSpore安装成功了。 ## 升级MindSpore版本 diff --git a/install/mindspore_cpu_macos_install_source_en.md b/install/mindspore_cpu_macos_install_source_en.md index e0d82d5a4e3aa272d3708685e0427b66a85b3f24..bafa4c2889a3b16c79fed9d2a205a1a86333c20a 100644 --- a/install/mindspore_cpu_macos_install_source_en.md +++ b/install/mindspore_cpu_macos_install_source_en.md @@ -62,10 +62,17 @@ Of which, ## Installation Verification ```bash -python -c "import mindspore;print(mindspore.__version__)" +python -c "import mindspore;mindspore.check()" ``` -If the MindSpore version number is displayed, it means that MindSpore is installed successfully, and if the output is `No module named 'mindspore'`, it means that the installation was not successful. +The outputs should be the same as: + +```text +mindspore version: __version__ +The result of multiplication calculation is correct, mindshare installation successful! +``` + +It means MindSpore has been installed successfully. ## Version Update diff --git a/install/mindspore_cpu_win_install_conda.md b/install/mindspore_cpu_win_install_conda.md index 08991b52b05b9c409ceeb2dd964d88fa89427828..497e5cca01bd3f5f945df05829f852e094f060a2 100644 --- a/install/mindspore_cpu_win_install_conda.md +++ b/install/mindspore_cpu_win_install_conda.md @@ -66,10 +66,17 @@ pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/{version}/MindSp ## 验证是否安装成功 ```bash -python -c "import mindspore;mindspore.__version__" +python -c "import mindspore;mindspore.check()" ``` -如果输出MindSpore版本号,说明MindSpore安装成功了,如果输出`No module named 'mindspore'`说明未安装成功。 +如果输出: + +```text +mindspore version: 版本号 +The result of multiplication calculation is correct, mindshare installation successful! +``` + +说明MindSpore安装成功了。 ## 升级MindSpore版本 diff --git a/install/mindspore_cpu_win_install_pip.md b/install/mindspore_cpu_win_install_pip.md index b0db5d7c962010bf54d35b1d6c8cc1cf9a42b835..c8a72585945b176d7ce52b40e1434363ea7fda4d 100644 --- a/install/mindspore_cpu_win_install_pip.md +++ b/install/mindspore_cpu_win_install_pip.md @@ -39,10 +39,17 @@ pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/{version}/MindSp ## 验证是否安装成功 ```bash -python -c "import mindspore;print(mindspore.__version__)" +python -c "import mindspore;mindspore.check()" ``` -如果输出MindSpore版本号,说明MindSpore安装成功了,如果输出`No module named 'mindspore'`说明未安装成功。 +如果输出: + +```text +mindspore version: 版本号 +The result of multiplication calculation is correct, mindshare installation successful! +``` + +说明MindSpore安装成功了。 ## 升级MindSpore版本 diff --git a/install/mindspore_cpu_win_install_pip_en.md b/install/mindspore_cpu_win_install_pip_en.md index 20297cbaaa912f97bf4491c81b1d9d99c7a19f93..61fe8cc15bbf0341683a2bc40f3a0b5d7c617632 100644 --- a/install/mindspore_cpu_win_install_pip_en.md +++ b/install/mindspore_cpu_win_install_pip_en.md @@ -39,10 +39,17 @@ Of which, ## Installation Verification ```bash -python -c "import mindspore;print(mindspore.__version__)" +python -c "import mindspore;mindspore.check()" ``` -If the MindSpore version number is displayed, it means that MindSpore is installed successfully, and if the output is `No module named 'mindspore'`, it means that the installation was not successful. +The outputs should be the same as: + +```text +mindspore version: __version__ +The result of multiplication calculation is correct, mindshare installation successful! +``` + +It means MindSpore has been installed successfully. ## Version Update diff --git a/install/mindspore_cpu_win_install_source.md b/install/mindspore_cpu_win_install_source.md index 2c6f4da41df47475d062678d72ac778a0352dae3..459b291d8113924ebd03f881d86e0ec52877b3aa 100644 --- a/install/mindspore_cpu_win_install_source.md +++ b/install/mindspore_cpu_win_install_source.md @@ -61,10 +61,17 @@ pip install build/package/mindspore-{version}-cp37-cp37m-win_amd64.whl -i https: ## 验证是否安装成功 ```bash -python -c "import mindspore;print(mindspore.__version__)" +python -c "import mindspore;mindspore.check()" ``` -如果输出MindSpore版本号,说明MindSpore安装成功了,如果输出`No module named 'mindspore'`说明未安装成功。 +如果输出: + +```text +mindspore version: 版本号 +The result of multiplication calculation is correct, mindshare installation successful! +``` + +说明MindSpore安装成功了。 ## 升级MindSpore版本 diff --git a/install/mindspore_cpu_win_install_source_en.md b/install/mindspore_cpu_win_install_source_en.md index 33a60fe6bb131eb1e8369d3e1ecd99a4dd83fe0c..98f4343aa7619a7aee235b70d3ba0c3dfc6dee93 100644 --- a/install/mindspore_cpu_win_install_source_en.md +++ b/install/mindspore_cpu_win_install_source_en.md @@ -58,10 +58,17 @@ Of which, ## Installation Verification ```bash -python -c "import mindspore;print(mindspore.__version__)" +python -c "import mindspore;mindspore.check()" ``` -If the MindSpore version number is displayed, it means that MindSpore is installed successfully, and if the output is `No module named 'mindspore'`, it means that the installation was not successful. +The outputs should be the same as: + +```text +mindspore version: __version__ +The result of multiplication calculation is correct, mindshare installation successful! +``` + +It means MindSpore has been installed successfully. ## Version Update diff --git a/install/mindspore_gpu_install_conda.md b/install/mindspore_gpu_install_conda.md index d2af0fc91479304cae6d6d15728f24ece205de32..0ca39ff4ea5837a515dadce8d464e6c216aec628 100644 --- a/install/mindspore_gpu_install_conda.md +++ b/install/mindspore_gpu_install_conda.md @@ -70,6 +70,23 @@ pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/{version}/MindSp ## 验证是否成功安装 +方法一: + +```bash +python -c "import mindspore;mindspore.check()" +``` + +如果输出: + +```text +mindspore version: 版本号 +The result of multiplication calculation is correct, mindshare installation successful! +``` + +说明MindSpore安装成功了。 + +方法二: + ```python import numpy as np from mindspore import Tensor diff --git a/install/mindspore_gpu_install_docker.md b/install/mindspore_gpu_install_docker.md index 83d4abb209f88f7901035a16efbf585d8348a067..aef0f04c862e2f790f3ed6a18c7e478c0de0defb 100644 --- a/install/mindspore_gpu_install_docker.md +++ b/install/mindspore_gpu_install_docker.md @@ -102,37 +102,54 @@ docker run -it -v /dev/shm:/dev/shm --runtime=nvidia --privileged=true swr.cn-so - 如果你安装的是指定版本`x.y.z`的容器。 按照上述步骤进入MindSpore容器后,测试Docker是否正常工作,请运行下面的Python代码并检查输出: + +方法一: - ```python - import numpy as np - import mindspore.context as context - import mindspore.ops as ops - from mindspore import Tensor +```bash +python -c "import mindspore;mindspore.check()" +``` - context.set_context(mode=context.PYNATIVE_MODE, device_target="GPU") +如果输出: - x = Tensor(np.ones([1,3,3,4]).astype(np.float32)) - y = Tensor(np.ones([1,3,3,4]).astype(np.float32)) - print(ops.add(x, y)) - ``` +```text +mindspore version: 版本号 +The result of multiplication calculation is correct, mindshare installation successful! +``` - 代码成功运行时会输出: +至此,你已经成功通过Docker方式安装了MindSpore GPU版本。 - ```text - [[[ 2. 2. 2. 2.], - [ 2. 2. 2. 2.], - [ 2. 2. 2. 2.]], +方法二: + +```python +import numpy as np +import mindspore.context as context +import mindspore.ops as ops +from mindspore import Tensor - [[ 2. 2. 2. 2.], - [ 2. 2. 2. 2.], - [ 2. 2. 2. 2.]], +context.set_context(mode=context.PYNATIVE_MODE, device_target="GPU") + +x = Tensor(np.ones([1,3,3,4]).astype(np.float32)) +y = Tensor(np.ones([1,3,3,4]).astype(np.float32)) +print(ops.add(x, y)) +``` - [[ 2. 2. 2. 2.], - [ 2. 2. 2. 2.], - [ 2. 2. 2. 2.]]] - ``` +代码成功运行时会输出: + +```text +[[[ 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.]]] +``` - 至此,你已经成功通过Docker方式安装了MindSpore GPU版本。 +至此,你已经成功通过Docker方式安装了MindSpore GPU版本。 - 如果你安装的是`runtime`标签的容器,需要自行安装MindSpore。 diff --git a/install/mindspore_gpu_install_docker_en.md b/install/mindspore_gpu_install_docker_en.md index f9fb55f030b449cf9fdad9baec1cb1d6a79f7ec8..df54c61ef7fbc344277937ac54a1b5e46d25fc3f 100644 --- a/install/mindspore_gpu_install_docker_en.md +++ b/install/mindspore_gpu_install_docker_en.md @@ -102,35 +102,51 @@ of which, - If you are installing the container of the specified version `x.y.z`. After entering the MindSpore container according to the above steps, to test whether the Docker container is working properly, please run the following Python code and check the output: + +i: + +```bash +python -c "import mindspore;mindspore.check()" +``` + +- The outputs should be the same as: + +```text +mindspore version: __version__ +The result of multiplication calculation is correct, mindshare installation successful! +``` + +It means MindSpore has been installed by docker successfully. - ```python - import numpy as np - import mindspore.context as context - import mindspore.ops as ops - from mindspore import Tensor +ii: +```python +import numpy as np +import mindspore.context as context +import mindspore.ops as ops +from mindspore import Tensor - context.set_context(mode=context.PYNATIVE_MODE, device_target="GPU") +context.set_context(mode=context.PYNATIVE_MODE, device_target="GPU") - x = Tensor(np.ones([1,3,3,4]).astype(np.float32)) - y = Tensor(np.ones([1,3,3,4]).astype(np.float32)) - print(ops.add(x, y)) - ``` +x = Tensor(np.ones([1,3,3,4]).astype(np.float32)) +y = Tensor(np.ones([1,3,3,4]).astype(np.float32)) +print(ops.add(x, y)) +``` - The outputs should be the same as: +The outputs should be the same as: - ```text - [[[ 2. 2. 2. 2.], - [ 2. 2. 2. 2.], - [ 2. 2. 2. 2.]], +```text +[[[ 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.]], - [[ 2. 2. 2. 2.], - [ 2. 2. 2. 2.], - [ 2. 2. 2. 2.]]] - ``` +[[ 2. 2. 2. 2.], +[ 2. 2. 2. 2.], +[ 2. 2. 2. 2.]]] +``` It means MindSpore has been installed by docker successfully. diff --git a/install/mindspore_gpu_install_pip.md b/install/mindspore_gpu_install_pip.md index a47340968b117046e2ba097548c687f97d607d3f..3cdf53289e11890d5d37cbbee3531a64757e248a 100644 --- a/install/mindspore_gpu_install_pip.md +++ b/install/mindspore_gpu_install_pip.md @@ -45,6 +45,23 @@ pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/{version}/MindSp ## 验证是否成功安装 +方法一: + +```bash +python -c "import mindspore;mindspore.check()" +``` + +如果输出: + +```text +mindspore version: 版本号 +The result of multiplication calculation is correct, mindshare installation successful! +``` + +说明MindSpore安装成功了。 + +方法二: + ```python import numpy as np from mindspore import Tensor diff --git a/install/mindspore_gpu_install_pip_en.md b/install/mindspore_gpu_install_pip_en.md index fc51e6e74cbf34ff5e651b46f2d84229eeb3d2c5..72012e9e109a4c40fd77184815fe652031765321 100644 --- a/install/mindspore_gpu_install_pip_en.md +++ b/install/mindspore_gpu_install_pip_en.md @@ -45,6 +45,23 @@ Of which, ## Installation Verification +i: + +```bash +python -c "import mindspore;mindspore.check()" +``` + +The outputs should be the same as: + +```text +mindspore version: __version__ +The result of multiplication calculation is correct, mindshare installation successful! +``` + +It means MindSpore has been installed successfully. + +ii: + ```python import numpy as np from mindspore import Tensor diff --git a/install/mindspore_gpu_install_source.md b/install/mindspore_gpu_install_source.md index 214a78b4998b15d276c8aef598c3ff7f4ad20318..48a6d4bf0d6f0c0b1f0159928ac193f13ea22f70 100644 --- a/install/mindspore_gpu_install_source.md +++ b/install/mindspore_gpu_install_source.md @@ -89,6 +89,23 @@ pip install build/package/mindspore_gpu-{version}-cp37-cp37m-linux_x86_64.whl -i ## 验证是否成功安装 +方法一: + +```bash +python -c "import mindspore;mindspore.check()" +``` + +如果输出: + +```text +mindspore version: 版本号 +The result of multiplication calculation is correct, mindshare installation successful! +``` + +说明MindSpore安装成功了。 + +方法二: + ```python import numpy as np from mindspore import Tensor diff --git a/install/mindspore_gpu_install_source_en.md b/install/mindspore_gpu_install_source_en.md index b6c7e5fe655b7fdb36c2aa601687fe32047c2a89..bbe49f414aba61345eaafbca43121f632ffc4070 100644 --- a/install/mindspore_gpu_install_source_en.md +++ b/install/mindspore_gpu_install_source_en.md @@ -86,6 +86,23 @@ Of which, ## Installation Verification +i: + +```bash +python -c "import mindspore;mindspore.check()" +``` + +The outputs should be the same as: + +```text +mindspore version: __version__ +The result of multiplication calculation is correct, mindshare installation successful! +``` + +It means MindSpore has been installed successfully. + +ii: + ```python import numpy as np from mindspore import Tensor diff --git a/install/third_party/third_party_cpu_install.md b/install/third_party/third_party_cpu_install.md index fb762174b68e99a17297519a83e04a80d5fdc338..c0e9e146cd1a582a465e120a05cdd449d2a74611 100644 --- a/install/third_party/third_party_cpu_install.md +++ b/install/third_party/third_party_cpu_install.md @@ -183,7 +183,7 @@ ms-sd@mssd:~/Python-3.7.5$ sudo ln -s /usr/local/python3.7.5/bin/pip3 /usr/bin/p (10)输入验证,Python已更改为3.7.5版本 -```python +```shell ms-sd@mssd:~/Python-3.7.5$ python3 Python 3.7.5 (default, Dec 19 2020, 11:29:09) [GCC 7.3.0] on linux @@ -370,14 +370,17 @@ success building mindspore project! ms-sd@mssd:~/mindspore$ sudo pip3 install /mindspore/build/package/mindspore-1.1.0-cp37-cp37m-linux_x86_64.whl ``` -(6)导入测试 +(6)验证安装是否成功 -```python3 -ms-sd@mssd:~/mindspore$ sudo python3 -Python 3.7.5 (default, Dec 19 2020, 13:04:49) -[GCC 7.3.0] on linux -Type "help", "copyright", "credits" or "license" for more information. ->>> import mindspore ->>> mindspore.__version__ -'1.1.0' +```bash +python -c "import mindspore;mindspore.check()" ``` + +如果输出为: + +```text +mindspore version: 版本号 +The result of multiplication calculation is correct, mindshare installation successful! +``` + +说明MindSpore安装成功了。