Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered.
|
5 years ago | |
---|---|---|
.. | ||
src | 5 years ago | |
.gitignore | 5 years ago | |
CMakeLists.txt | 5 years ago | |
Makefile | 5 years ago | |
README.md | 5 years ago | |
dump_with_testcase_mge.py | 5 years ago | |
main.cpp | 5 years ago |
Load a model and run, for testing/debugging/profiling.
Build MegEngine from source following README.md. It will also produce the executable, load_and_run
, which loads a model and runs the test cases attached to the model.
Dump the model by calling the python API megengine.jit.trace.dump()
.
Append the test cases to the dumped model using dump_with_testcase_mge.py.
The basic usage of dump_with_testcase_mge.py is
python3 dump_with_testcase_mge.py model -d input_description -o model_with_testcases
where model
is the file dumped at step 1, input_description
describes the input data of the test cases, and model_with_testcases
is the saved model with test cases.
input_description
can be provided in the following ways:
var0:file0;var1:file1...
meaning that var0
should usefile0
, var1
should use image file1
and so on. If there--resize-input
option.var0:#rand(min, max, shape...);var1:#rand(min, max)...
[min, max)
, optionally overriding its shape.For more usages, run
python3 dump_with_testcase_mge.py --help
Obtain the model file by running xornet.py.
Dump the file with test cases attached to the model.
python3 dump_with_testcase_mge.py xornet_deploy.mge -o xornet.mge -d "#rand(0.1, 0.8, 4, 2)"
Verify the correctness by running load_and_run
at the target platform.
load_and_run xornet.mge
MegEngine 安装包中集成了使用 GPU 运行代码所需的 CUDA 环境,不用区分 CPU 和 GPU 版。 如果想要运行 GPU 程序,请确保机器本身配有 GPU 硬件设备并安装好驱动。 如果你想体验在云端 GPU 算力平台进行深度学习开发的感觉,欢迎访问 MegStudio 平台
C++ Cuda Python C SVG other