TVM_mobilefacenet
demo about how to deploy tvm model via TVM .
Usage
update HOME_TVM in CMakeLists.txt
mkdir build
cd build
cmake ../
make
TODO
- MTCNN TVM implementation
demo about how to deploy tvm model via TVM .
update HOME_TVM in CMakeLists.txt
mkdir build
cd build
cmake ../
make
there is no .so file in the repo..
I want to use mobilefacenet as a classification model instead of an embedding model, but when I run the compile script as follows, pay attention that the checkpoint is not trimmed after the embedding layer but kept the last fully-connetcted layer, I just want get the prob of which person one face belongs to .
import numpy as np
import argparse
import nnvm.compiler
import nnvm.testing
import tvm
from tvm.contrib import graph_runtime
import mxnet as mx
from mxnet import ndarray as nd
prefix,epoch = "/app/model/model-mobilefacenets/model-y1-softmax", 0
sym, arg_params, aux_params = mx.model.load_checkpoint(prefix, epoch)
image_size = (112, 112)
opt_level = 3
shape_dict = {'data': (1, 3, *image_size)}
target = tvm.target.create("cuda")
# "target" means your target platform you want to compile.
#target = tvm.target.create("llvm -mcpu=broadwell")
nnvm_sym, nnvm_params = nnvm.frontend.from_mxnet(sym, arg_params, aux_params)
the error messages is as follows:
OpNotImplemented: Operator BlockGrad is not supported in frontend MXNet.
What can I do to deal with this error? Please help me out, thank you very much.
@szad670401
got such errors after make:
/usr/bin/ld: CMakeFiles/tvm_mobilefacenet.dir/tvm_runtime_pack.cc.o: undefined reference to symbol 'dlclose@@GLIBC_2.2.5'
/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libdl.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
CMakeFiles/tvm_mobilefacenet.dir/build.make:125: recipe for target '../tvm_mobilefacenet' failed
make[2]: *** [../tvm_mobilefacenet] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/tvm_mobilefacenet.dir/all' failed
make[1]: *** [CMakeFiles/tvm_mobilefacenet.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
in the dir: model-y1-test2, there is no 'deploy_lib.so'
Scanning dependencies of target tvm_mobilefacenet
[ 33%] Building CXX object CMakeFiles/tvm_mobilefacenet.dir/tvm_runtime_pack.cc.o
[ 66%] Building CXX object CMakeFiles/tvm_mobilefacenet.dir/main.cpp.o
[100%] Linking CXX executable ../tvm_mobilefacenet
CMakeFiles/tvm_mobilefacenet.dir/tvm_runtime_pack.cc.o: In function TVMModFree': tvm_runtime_pack.cc:(.text+0x2441): undefined reference to
TVMObjectFree'
collect2: error: ld returned 1 exit status
CMakeFiles/tvm_mobilefacenet.dir/build.make:170: recipe for target '../tvm_mobilefacenet' failed
make[2]: *** [../tvm_mobilefacenet] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/tvm_mobilefacenet.dir/all' failed
make[1]: *** [CMakeFiles/tvm_mobilefacenet.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
root@3301baaa7ede:/data/workspace/tvm_mobilefacenet/build# ls
CMakeCache.txt CMakeFiles Makefile cmake_install.cmake
terminate called after throwing an instance of 'dmlc::Error'
what(): [08:22:49] /data/workspace/tvm/include/../src/runtime/registry.cc:78: Check failed: override: Global PackedFunc __tvm_set_device is already registered
Stack trace:
[bt] (0) ../tvm_mobilefacenet(dmlc::LogMessageFatal::~LogMessageFatal()+0x4a) [0x55b1adafd5f2]
[bt] (1) ../tvm_mobilefacenet(tvm::runtime::Registry::Register(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, bool)+0x1ef) [0x55b1adaeb25d]
[bt] (2) ../tvm_mobilefacenet(+0x2d404) [0x55b1adafb404]
[bt] (3) ../tvm_mobilefacenet(+0x2e071) [0x55b1adafc071]
[bt] (4) ../tvm_mobilefacenet(+0x7f64d) [0x55b1adb4d64d]
[bt] (5) /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x80) [0x7f2a5245b150]
[bt] (6) ../tvm_mobilefacenet(+0x16b6a) [0x55b1adae4b6a]
Aborted (core dumped)
I am getting the following error:
terminate called after throwing an instance of 'dmlc::Error'
what(): [16:21:15] /home/nchafni/Cyrus/tvm_test/src/runtime/module_util.cc:55: Check failed: f != nullptr: Loader of opencl(module.loadbinary_opencl) is not presented.
Stack trace:
[bt] (0) ./tvm_test(+0xc024) [0x55eb3bfd7024]
[bt] (1) ./tvm_test(+0x1503a) [0x55eb3bfe003a]
[bt] (2) ./tvm_test(+0x3406b) [0x55eb3bfff06b]
[bt] (3) ./tvm_test(+0x1ab99) [0x55eb3bfe5b99]
[bt] (4) ./tvm_test(+0x23456) [0x55eb3bfee456]
[bt] (5) ./tvm_test(+0xe444) [0x55eb3bfd9444]
[bt] (6) ./tvm_test(+0x3abbc) [0x55eb3c005bbc]
[bt] (7) ./tvm_test(+0x15c75) [0x55eb3bfe0c75]
[bt] (8) ./tvm_test(+0xcf91) [0x55eb3bfd7f91]
When building deploy_lib.so
, I did not set OPENCL to on, so I am not sure what is causing this error
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.