You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 678 B

123456789101112131415161718192021222324252627
  1. # Example to deploy a MegEngine model using C++
  2. * Step 1: compile MegEngine for deployment following [README.md](../../README.md)
  3. * Step 2: compile the example by
  4. ```
  5. $CXX -o xor_deploy -I$MGE_INSTALL_PATH/include xor_deploy.cpp -L$MGE_INSTALL_PATH/lib64/ -lmegengine
  6. ```
  7. where `$CXX` is the C++ compiler and `$MGE_INSTALL_PATH` is the MegEngine install path.
  8. * Step 3: run with dumped model
  9. The dumped model can be obtained by running [xornet.py](xornet.py)
  10. ```
  11. LD_LIBRARY_PATH=$MGE_INSTALL_PATH/lib64:$LD_LIBRARY_PATH ./xor_deploy xornet_deploy.mge 0.6 0.9
  12. ```
  13. Sample output:
  14. ```
  15. Predicted: 0.999988 1.2095e-05
  16. ```

MegEngine 安装包中集成了使用 GPU 运行代码所需的 CUDA 环境,不用区分 CPU 和 GPU 版。 如果想要运行 GPU 程序,请确保机器本身配有 GPU 硬件设备并安装好驱动。 如果你想体验在云端 GPU 算力平台进行深度学习开发的感觉,欢迎访问 MegStudio 平台

Contributors (1)