Question about Conv1D support

I’m using keras.layers.Conv1D in my model. In order to compile my model, i transformed the Conv1D layer to Conv2D by setting the kernel_size to (kernel_size, 1) and expanding my data from 3D to 4D. But When i compile the new output model i got an error:

Traceback (most recent call last):
  File "/projects/TvmExperiment/code/compile_keras_model.py", line 18, in <module>
    mod, params = relay.frontend.from_keras(model, shape_dict)
  File "/projects/tvm/python/tvm/relay/frontend/keras.py", line 748, in from_keras
    return _module.Module.from_expr(func), params
  File "/projects/tvm/python/tvm/relay/module.py", line 204, in from_expr
    return _module.Module_FromExpr(expr, funcs, defs)
  File "/projects/tvm/python/tvm/_ffi/_ctypes/function.py", line 210, in __call__
    raise get_last_ffi_error()
tvm._ffi.base.TVMError: Traceback (most recent call last):
  [bt] (8) /projects/tvm/build/libtvm.so(tvm::relay::Expr tvm::relay::TypeInferencer::Resolver::AttachCheckedType<tvm::relay::FunctionNode>(tvm::relay::FunctionNode const*)+0x168) [0x7fb023e45398]
  [bt] (7) /projects/tvm/build/libtvm.so(tvm::relay::ExprMutator::VisitExpr_(tvm::relay::FunctionNode const*)+0x900) [0x7fb023bf93d0]
  [bt] (6) /projects/tvm/build/libtvm.so(tvm::relay::ExprMutator::VisitExpr(tvm::relay::Expr const&)+0x9e) [0x7fb023bfa1be]
  [bt] (5) /projects/tvm/build/libtvm.so(tvm::relay::ExprFunctor<tvm::relay::Expr (tvm::relay::Expr const&)>::VisitExpr(tvm::relay::Expr const&)+0x161) [0x7fb023c02731]
  [bt] (4) /projects/tvm/build/libtvm.so(std::_Function_handler<tvm::relay::Expr (tvm::NodeRef const&, tvm::relay::ExprFunctor<tvm::relay::Expr (tvm::relay::Expr const&)>*), tvm::relay::ExprFunctor<tvm::relay::Expr (tvm::relay::Expr const&)>::InitVTable()::{lambda(tvm::NodeRef const&, tvm::relay::ExprFunctor<tvm::relay::Expr (tvm::relay::Expr const&)>*)#3}>::_M_invoke(std::_Any_data const&, tvm::NodeRef const&, tvm::relay::ExprFunctor<tvm::relay::Expr (tvm::relay::Expr const&)>*&&)+0x34) [0x7fb023bfcb44]
  [bt] (3) /projects/tvm/build/libtvm.so(tvm::relay::TypeInferencer::Resolver::VisitExpr_(tvm::relay::VarNode const*)+0x63) [0x7fb023e40c93]
  [bt] (2) /projects/tvm/build/libtvm.so(tvm::relay::TypeInferencer::Resolver::VisitVar(tvm::relay::Var const&)+0xb3) [0x7fb023e409b3]
  [bt] (1)/projects/tvm/build/libtvm.so(tvm::relay::Expr tvm::relay::TypeInferencer::Resolver::AttachCheckedType<tvm::relay::VarNode>(tvm::relay::VarNode const*)+0x151) [0x7fb023e3d881]
  [bt] (0) /projects/tvm/build/libtvm.so(dmlc::LogMessageFatal::~LogMessageFatal()+0x32) [0x7fb02384bd72]
  File "/projects/tvm/src/relay/pass/type_infer.cc", line 663
TVMError: Check failed: checked_type.as<IncompleteTypeNode>() == nullptr: Cannot resolve type of Var(conv2d_1_input) at (nullptr)

so I’m just wondering how to solve this problem and when will tvm support Conv1D? :sob:

It seems like that you didn’t have conv2d_1_input in the shape dict passed to the frontend converter. Could you share your script?

Re on Conv1D op:
You can create an issue on the github to ask for help for Conv1D op. You are more than welcomed to help add this op to TVM. :slight_smile:

Have you support Conv1D operator? Could you share the code? Thx!!