同步操作将从 MindSpore/mindquantum 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
This document describes how to use Docker to quickly install MindQuantum. First, you need to install MindSpore through Docker. The process is introduced on MindSpore's official website. This part will be repeated below.
For the CPU backend, you can directly use the following command to obtain the latest stable image:
docker pull swr.cn-south-1.myhuaweicloud.com/mindspore/mindspore-cpu:{tag}
In which, {tag} corresponds to the tag in the above table.
Execute the following command to start the Docker container instance:
docker run -it swr.cn-south-1.myhuaweicloud.com/mindspore/mindspore-cpu:{tag} /bin/bash
In which, {tag} corresponds to the tag in the above table.
After entering the MindSpore container according to the above steps, to test whether Docker is working properly, please run the following Python code and check the output:
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="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))
When the code runs successfully, it will output:
[[[[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.]]]]
At this point, you have successfully installed the MindSpore CPU version by Docker.
Enter the Docker container.
docker exec -it {docker_container} /bin/bash
In which, {docker_container} is the id or name of the docker container.
Choose to install by pip or by compiling.
Install by compiling:
git clone https://gitee.com/mindspore/mindquantum.git
cd ~/mindquantum
python setup.py install --user
Install by pip:
pip install https://hiq.huaweicloud.com/download/mindquantum/newest/linux/mindquantum-master-cp37-cp37m-linux_x86_64.whl -i https://pypi.tuna.tsinghua.edu.cn/simple
python -c 'import mindquantum'
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。