README_CN.md 4.5 KB
Newer Older
1 2
# MegEngine

Z
zhanghaolong 已提交
3 4 5
<p align="center">
  <img width="250" height="109" src="logo.png">
</p>
6 7 8

[English](README.md) | 中文

W
wenjuan 已提交
9
MegEngine 是一个快速、可拓展、易于使用且支持自动求导的深度学习框架。
10 11 12 13 14 15

------


## 安装说明

J
jiakai 已提交
16
**注意:** MegEngine 现在支持在 Linux-64bit/Windows-64bit/macos-10.14及其以上 (MacOS只支持cpu) 等平台上安装 Python 包,支持Python3.5 到 Python3.8。对于 Windows 10 用户,可以通过安装 [Windows Subsystem for Linux (WSL)](https://docs.microsoft.com/en-us/windows/wsl) 进行体验,同时我们也原生支持Windows。MegEngine 也支持在很多其它平台上进行推理运算。
17 18 19 20 21 22

### 通过包管理器安装

通过 pip 安装的命令如下:

```bash
Z
zhanghaolong 已提交
23
python3 -m pip install megengine -f https://megengine.org.cn/whl/mge.html
24 25 26 27 28 29
```

## 通过源码编译安装

### 环境依赖

J
jiakai 已提交
30
大多数编译 MegEngine 的依赖位于 [third_party](third_party) 目录,可以通过以下命令自动安装:
31 32

```bash
J
jiakai 已提交
33 34
./third_party/prepare.sh
./third_party/install-mkl.sh
35 36 37 38
```

但是有一些依赖需要手动安装:

Z
zhanghaolong 已提交
39 40 41 42
* [CUDA](https://developer.nvidia.com/cuda-toolkit-archive)(>=10.1), [cuDNN](https://developer.nvidia.com/cudnn)(>=7.6) ,如果需要编译支持 CUDA 的版本。
* [TensorRT](https://docs.nvidia.com/deeplearning/sdk/tensorrt-archived/index.html)(>=5.1.5) ,如果需要编译支持 TensorRT 的版本。
* LLVM/Clang(>=6.0) ,如果需要编译支持 Halide JIT 的版本(默认开启)。
* Python(>=3.5), Numpy, SWIG(>=3.0) ,如果需要编译生成 Python 模块。
43 44 45

### 开始编译

Z
zhanghaolong 已提交
46 47 48 49
MegEngine使用CMake作为构建工具。我们提供以下脚本来帮助编译:

* [host_build.sh](scripts/cmake-build/host_build.sh) 用于本地编译。
参数 -h 可用于查询脚本支持的参数:
J
jiakai 已提交
50

Z
zhanghaolong 已提交
51 52 53 54 55
  ```
  scripts/cmake-build/host_build.sh -h
  ```
* [cross_build_android_arm_inference.sh](scripts/cmake-build/cross_build_android_arm_inference.sh) 用于ARM-安卓交叉编译。
参数 -h 可用于查询脚本支持的参数:
J
jiakai 已提交
56

Z
zhanghaolong 已提交
57 58 59 60 61
  ```
  scripts/cmake-build/cross_build_android_arm_inference.sh -h
  ```
* [cross_build_linux_arm_inference.sh](scripts/cmake-build/cross_build_linux_arm_inference.sh) 用于ARM-Linux交叉编译。
参数 -h 可用于查询脚本支持的参数:
J
jiakai 已提交
62

Z
zhanghaolong 已提交
63 64 65
  ```
  scripts/cmake-build/cross_build_linux_arm_inference.sh -h
  ```
J
jiakai 已提交
66
* [cross_build_ios_arm_inference.sh](scripts/cmake-build/cross_build_ios_arm_inference.sh) 用于iOS交叉编译。
Z
zhanghaolong 已提交
67 68 69 70 71 72
  参数 -h 可用于查询脚本支持的参数:

  ```
  scripts/cmake-build/cross_build_ios_arm_inference.sh
  ```
  更多细节请参考 [BUILD_README.md](scripts/cmake-build/BUILD_README.md)
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99


## 如何参与贡献

* MegEngine 依据 [贡献者公约(Contributor Covenant)](https://contributor-covenant.org)来管理开源社区。请阅读 [行为准则](CODE_OF_CONDUCT.md) 了解更多信息。
* 每一名 MegEngine 的贡献者都需要签署贡献者许可协议(Contributor License Agreement,CLA)来明确贡献内容相关的知识产权许可。更多细节请参考 [协议内容](CONTRIBUTOR_LICENSE_AGREEMENT.md)
* 我们欢迎你通过以下方式来帮助 MegEngine 变得更好:
    * 贡献代码;
    * 完善[文档](https://github.com/MegEngine/Docs)
    *[MegEngine 论坛](https://discuss.megengine.org.cn) 和 Stack Overflow 回答问题;
    *[MegEngine Model Hub](https://github.com/megengine/hub) 贡献新模型;
    *[MegStudio](https://studio.brainpp.com) 平台尝试新想法;
    * 报告使用中的 [Bugs 和 Issues](https://github.com/MegEngine/MegEngine/issues)
    * 审查 [Pull Requests](https://github.com/MegEngine/MegEngine/pulls)
    * 给 MegEngine 点亮小星星;
    * 在你的论文和文章中引用 MegEngine;
    * 向你的好友推荐 MegEngine;
    * ...

我们相信我们能够搭建一个开放友善的开源社区环境,用人工智能造福人类。

## 联系我们

* 问题: [github.com/MegEngine/MegEngine/issues](https://github.com/MegEngine/MegEngine/issues)
* 邮箱: [megengine-support@megvii.com](mailto:megengine-support@megvii.com)
* 论坛: [discuss.megengine.org.cn](https://discuss.megengine.org.cn)
* QQ: 1029741705
J
jiakai 已提交
100
* OPENI: [openi.org.cn/MegEngine](https://www.openi.org.cn/html/2020/Framework_0325/18.html)
101 102 103 104 105 106 107 108 109 110 111

## 资源

- [MegEngine](https://megengine.org.cn)
- [MegStudio](https://studio.brainpp.com)
- [Brain++](https://brainpp.megvii.com)

## 开源许可

MegEngine 使用 Apache License, Version 2.0

J
jiakai 已提交
112
Copyright (c) 2014-2021 Megvii Inc. All rights reserved.