HI all! Could you please suggest a way how to execute a model up to a certain named Tensor? Consider the following code:
iname='Rcnn_ctcV3/Inputs' # Name of input node
oname='Rcnn_ctcV3/expand_conv1/add_1/add' # Name of output node, a subject to change
# Read TF Graph and GraphDef from file
g,gd=fropen()
sym,params=nnvm.frontend.from_tensorflow(gd)
# Query TF for meta-data and construct dictionaries
i=g.get_tensor_by_name(iname+':0')
o=g.get_tensor_by_name(oname+':0')
i_shape_dict={iname+':0': i.shape.as_list()}
i_dtype_dict={iname+':0': i.dtype.as_numpy_dtype()}
# Build the model with TVM
with nnvm.compiler.build_config(opt_level=opt_level):
graph,lib,params=nnvm.compiler.build(graph=sym, target='llvm', shape=i_shape_dict, dtype=i_dtype_dict, params=params)
m=graph_runtime.create(graph, lib, ctx=tvm.cpu(0))
o_data=m.get_output(0, tvm.nd.empty(o.shape.as_list(), o.dtype.name)) # how to query oname ??
Here we export and build the model, then specify 0
as output node index, like in tutorials. The questions are:
- Why zero is always the correct ID of output node?
- How to determine the index of some intermediate node by its name, to, say, execute only the bottom half of the model?
Regards