AttributeError: Module has no function 'get_num_outputs' ,when deploy cross compile model


#1

Env:

  • pytorch1.0.1
  • cuda9.0
  • tvm6.0
  • cross compile linaro7.4.1-x86_64-aarch64-linux-gnu
  • board:TX2

remote device**(TX2)**
jsi@jsi-desktop:~$python -m tvm.exec.rpc_server --host 0.0.0.0 --port 9090
INFO:RPCServer:bind to 0.0.0.0:9090
INFO:RPCServer:connection from (‘10.4.11.10’,50308)
INFO:RPCServer:load_module /tmp/tmppjatvnp7/net.jar
INFO:RPCServer:Finish servering (‘10.4.11.10’,50308)
local machine
When I run python deploy_model_on_rasp.py on host, it occurs :
File /home1/marong/.tvm_test_data/data/cat.png exists, skip.
File /home1/marong/.tvm_test_data/data/imagenet1000_clsid_to_human.txt exists, skip.
Cannot find config for target=llvm -target=aarch64-linux-gnu, workload=(‘dense’, (1, 512, ‘float32’), (1000, 512, ‘float32’), 0, ‘float32’). A fallback configuration is used, which may bring great performance regression.
Traceback (most recent call last):
File “deploy_model_on_rasp.py”, line 214, in
module = runtime.create(graph, rlib, ctx)
File “/home1/marong/tvm/python/tvm/contrib/graph_runtime.py”, line 56, in create
return GraphModule(fcreate(graph_json_str, hmod, *device_type_id))
File “/home1/marong/tvm/python/tvm/contrib/graph_runtime.py”, line 130, in init
self._get_num_outputs = module[“get_num_outputs”]
File “/home1/marong/tvm/python/tvm/_ffi/function.py”, line 147, in getitem
return self.get_function(name)
File “/home1/marong/tvm/python/tvm/_ffi/function.py”, line 131, in get_function
“Module has no function ‘%s’” % name)
AttributeError: Module has no function ‘get_num_outputs’

The only change in deploy_model_on_rasp.py is setting my target with “llvm -target=aarch64-linux-gnu” and let “local_demo=False”.
And I have checked that the function ‘get_num_outputs’ does exists in tvm/python/tvm/_ffi/function.py
Can anyone give me some advice? Thank U