Failed to convert gluoncv yolov3 into tvm

Hi all,
I noticed there is a tutorial introducing how to convert yolov3 model from darknet to tvm. Now, I am trying to convert yolov3 from gluoncv to tvm but got an error like below:

  File "/home/lhy/Documents/Lib/tvm/nnvm/python/nnvm/frontend/mxnet.py", line 527, in from_mxnet
    sym = _from_mxnet_impl(symbol, {})
  File "/home/lhy/Documents/Lib/tvm/nnvm/python/nnvm/frontend/mxnet.py", line 486, in _from_mxnet_impl
    node = _convert_symbol(op_name, [], attr)
  File "/home/lhy/Documents/Lib/tvm/nnvm/python/nnvm/frontend/mxnet.py", line 392, in _convert_symbol
    _raise_not_supported('Operator: ' + op_name)
  File "/home/lhy/Documents/Lib/tvm/nnvm/python/nnvm/frontend/mxnet.py", line 24, in _raise_not_supported
    raise NotImplementedError(err)
NotImplementedError: Operator: _arange is not supported in nnvm.

Is it possible to implement the arange op in python (compatible with nnvm or relay)?

1 Like

I am not sure either what’s the plan for generators like arange as it’s quite popular in numpy

I compile gluon yolo3 model using the relay interface. It fails with a Segmentation fault as follow:

Segmentation fault: 11

Stack trace returned 10 entries:

[bt] (0) 0 libmxnet.so 0x00000001111a6560 mxnet::op::NDArrayOpProp::~NDArrayOpProp() + 3024

[bt] (1) 1 libmxnet.so 0x0000000112ec6406 mxnet::Storage::Get() + 4374

[bt] (2) 2 libsystem_platform.dylib 0x00007fff6c7f7b3d _sigtramp + 29

[bt] (3) 3 ??? 0x000000000000000c 0x0 + 12

[bt] (4) 4 libtvm.dylib 0x000000010d6b41cf void tvm::runtime::detail::unpack_call_dispatcher<bool, 0, 4, bool ()(tvm::Array<tvm::relay::Type, void> const&, int, tvm::Attrs const&, tvm::relay::TypeReporter const&)>::run<tvm::runtime::TVMArgValue, tvm::runtime::TVMArgValue, tvm::runtime::TVMArgValue, tvm::runtime::TVMArgValue>(bool ( const&)(tvm::Array<tvm::relay::Type, void> const&, int, tvm::Attrs const&, tvm::relay::TypeReporter const&), tvm::runtime::TVMArgs const&, tvm::runtime::TVMRetValue*, tvm::runtime::TVMArgValue&&, tvm::runtime::TVMArgValue&&, tvm::runtime::TVMArgValue&&, tvm::runtime::TVMArgValue&&) + 95

[bt] (5) 5 libtvm.dylib 0x000000010d6b4129 std::__1::__function::__func<void tvm::runtime::TypedPackedFunc<bool (tvm::Array<tvm::relay::Type, void> const&, int, tvm::Attrs const&, tvm::relay::TypeReporter const&)>::AssignTypedLambda<bool ()(tvm::Array<tvm::relay::Type, void> const&, int, tvm::Attrs const&, tvm::relay::TypeReporter const&)>(bool ()(tvm::Array<tvm::relay::Type, void> const&, int, tvm::Attrs const&, tvm::relay::TypeReporter const&))::‘lambda’(tvm::runtime::TVMArgs const&, tvm::runtime::TVMRetValue*), std::__1::allocator<void tvm::runtime::TypedPackedFunc<bool (tvm::Array<tvm::relay::Type, void> const&, int, tvm::Attrs const&, tvm::relay::TypeReporter const&)>::AssignTypedLambda<bool ()(tvm::Array<tvm::relay::Type, void> const&, int, tvm::Attrs const&, tvm::relay::TypeReporter const&)>(bool ()(tvm::Array<tvm::relay::Type, void> const&, int, tvm::Attrs const&, tvm::relay::TypeReporter const&))::‘lambda’(tvm::runtime::TVMArgs const&, tvm::runtime::TVMRetValue*)>, void (tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*)>::operator()(tvm::runtime::TVMArgs&&, tvm::runtime::TVMRetValue*&&) + 137

[bt] (6) 6 libtvm.dylib 0x000000010d8eff2d tvm::TypedEnvFunc<bool (tvm::Array<tvm::relay::Type, void> const&, int, tvm::Attrs const&, tvm::relay::TypeReporter const&)>::operator()(tvm::Array<tvm::relay::Type, void> const&, int, tvm::Attrs const&, tvm::relay::TypeReporter const&) const + 365

[bt] (7) 7 libtvm.dylib 0x000000010d8ef855 tvm::relay::TypeSolver::Solve() + 1125

[bt] (8) 8 libtvm.dylib 0x000000010d8d2994 tvm::relay::TypeInferencer::Infer(tvm::relay::Expr) + 116

[bt] (9) 9 libtvm.dylib 0x000000010d8d3b38 tvm::relay::InferType(tvm::relay::Function const&, tvm::relay::Module const&, tvm::relay::GlobalVar const&) + 472

Are there any solutions?

Same error!
gluoncv yolov3 to tvm deploy so

Could you open an issue against the TVM repository with a reproducible test case? We would be happy to investigate the bug and fix.

It seems relay mxnet frontend supports _arange operator. It may be able to load well with relay frontend.
If you’d like to just try yolov3 quickly with tvm, there is some sample code here.