I want to compile a model built using Tensorflow Keras, but am getting consistent segfaults. I have narrowed my code down to this minimal example (completely useless, untrained model):
import tensorflow.keras as keras
import tvm
import tvm.relay as relay
model = keras.Sequential()
model.add(keras.Input(shape=(2,), name='input'))
model.add(keras.layers.Flatten())
model.add(keras.layers.Dense(1))
mod, params_dict = relay.frontend.from_keras(model, {'input': (None, 2, 1, 1)})
with tvm.transform.PassContext(opt_level=3):
factory_module = relay.build(mod, target="llvm", params=params_dict)
My TVM installation is built from source, v0.10.0 with the default cmake configuration. Tensorflow is at v2.10.0 (is that the problem?).
GDB gives the following: 0x00007fff7bfcc096 in non-virtual thunk to tvm::tir::StmtExprMutator::VisitExpr(tvm::PrimExpr const&) () from /scratch/sv/buildsite/tvm/build/libtvm.so
.