Hi
I encounter following error when convert JIT trace to tvm.relayIR:
NotImplementedError: The following operators are not implemented: [‘prim::PythonOp’, ‘aten::ger’, ‘aten::or’, ‘aten::view_as’, ‘aten::index_put_’]
I know how to handle other four operators except prim::PythonOp.
Does anyone know how to solve this unimplemented Operator?
If I print out jit graph, I can’t saw prim::PythonOp in the graph. Thus I don’t know where it comes from.
I definitely use model.eval() and I know there’s post about unimplemented PythonOp which can be solved with tvm.relay.op.vision.roi_align. But my issue here is the model is very big and I don’t know where does this PythonOp come from.
@masahi
Thanks for your quick response.
Thus the possible solution should be:
First, find out which code logic use PythonOp like roi_align case.
Then, we check whether we can use tvm.relay.op.xxx to replace that logic.
If can, we replace tvm op with that logic in model and re-gen jit trace and convert to relay IR.
If can’t, then we can’t convert this jit graph by tvm.from_pytorch directly.
Am I right?
Yes, if you can map your python code to corresponding combination of relay ops, it could work. But this is always application specific so there is no generic way to support PythonOp in our “official” frontend. You can use the custom convert map to register your conversion.