Hi, I’m trying to follow the tutorial in https://docs.tvm.ai/tutorials/frontend/from_tensorflow.html# to use TVM parse a model from tensorflow, but I hit the folowing error. It seems the error occurs before TVM does something real for parsing, it fails on some initilization with ‘prelude’, I’m new to TVM, I’m not sure what’s going on here, can anyone help?
[15:28:12] /home/zheenwang/tvm/src/relay/ir/module.cc:286: Importing: /home/zheenwang/tvm/python/tvm/relay/std/prelude.rly
Traceback (most recent call last):
File “from_tensorflow.py”, line 18, in
mod, params = tvm.relay.frontend.from_tensorflow(graph_def,layout=layout,shape=shape_dict)
File “/home/zheenwang/tvm/python/tvm/relay/frontend/tensorflow.py”, line 2475, in from_tensorflow
g = GraphProto()
File “/home/zheenwang/tvm/python/tvm/relay/frontend/tensorflow.py”, line 1955, in init
self._prelude = Prelude(self._mod)
File “/home/zheenwang/tvm/python/tvm/relay/prelude.py”, line 533, in init
self.load_prelude()
File “/home/zheenwang/tvm/python/tvm/relay/prelude.py”, line 549, in load_prelude
self.mod.import_from_std(“prelude.rly”)
File “/home/zheenwang/tvm/python/tvm/relay/module.py”, line 240, in import_from_std
return _module.Module_ImportFromStd(self, file_to_import)
File “/home/zheenwang/tvm/python/tvm/_ffi/_ctypes/function.py”, line 207, in call
raise get_last_ffi_error()
tvm._ffi.base.TVMError: Traceback (most recent call last):
[bt] (5) /home/zheenwang/tvm/build/libtvm.so(TVMFuncCall+0x61) [0x7fec407fe3b1]
[bt] (4) /home/zheenwang/tvm/build/libtvm.so(+0xb6b27f) [0x7fec4070d27f]
[bt] (3) /home/zheenwang/tvm/build/libtvm.so(tvm::relay::ModuleNode::ImportFromStd(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)+0x176) [0x7fec4070d066]
[bt] (2) /home/zheenwang/tvm/build/libtvm.so(tvm::relay::ModuleNode::Import(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)+0x154) [0x7fec4070ce34]
[bt] (1) /home/zheenwang/tvm/build/libtvm.so(tvm::relay::FromText(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)+0xcb) [0x7fec4070915b]
[bt] (0) /home/zheenwang/tvm/build/libtvm.so(+0xc5798b) [0x7fec407f998b]
File “/home/zheenwang/tvm/python/tvm/_ffi/_ctypes/function.py”, line 72, in cfun
rv = local_pyfunc(*pyargs)
File “/home/zheenwang/tvm/python/tvm/relay/parser.py”, line 25, in fromtext
from tvm.relay import _parser
File “/home/zheenwang/tvm/python/tvm/relay/_parser.py”, line 218
raise ParseError(f"duplicate global var “{name}”")
^
SyntaxError: invalid syntax