Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered.
|
3 years ago | |
---|---|---|
.. | ||
README.md | 5 years ago | |
xor_deploy.cpp | 5 years ago | |
xornet.py | 3 years ago |
Step 1: compile MegEngine for deployment following README.md
Step 2: compile the example by
$CXX -o xor_deploy -I$MGE_INSTALL_PATH/include xor_deploy.cpp -L$MGE_INSTALL_PATH/lib64/ -lmegengine
where $CXX
is the C++ compiler and $MGE_INSTALL_PATH
is the MegEngine install path.
Step 3: run with dumped model
The dumped model can be obtained by running xornet.py
LD_LIBRARY_PATH=$MGE_INSTALL_PATH/lib64:$LD_LIBRARY_PATH ./xor_deploy xornet_deploy.mge 0.6 0.9
Sample output:
Predicted: 0.999988 1.2095e-05
MegEngine 安装包中集成了使用 GPU 运行代码所需的 CUDA 环境,不用区分 CPU 和 GPU 版。 如果想要运行 GPU 程序,请确保机器本身配有 GPU 硬件设备并安装好驱动。 如果你想体验在云端 GPU 算力平台进行深度学习开发的感觉,欢迎访问 MegStudio 平台
C++ Cuda Python C SVG other