[quick start tutorial] AttributeError: ‘Graph’ object has no attribute ‘find_nodes’

Traceback (most recent call last): File “/root/python_project/e2e_opt.py”, line 20, in mod = from_exported_program(exported_program, keep_params_as_input=True) File “/root/python_project/tvm/python/tvm/relax/frontend/torch/exported_program_translator.py”, line 454, in from_exported_program return ExportedProgramImporter().from_exported_program( File “/root/python_project/tvm/python/tvm/relax/frontend/torch/exported_program_translator.py”, line 309, in from_exported_program parameter_buffer_constant_vars, user_input_vars = self.create_input_vars(exported_program) File “/root/python_project/tvm/python/tvm/relax/frontend/torch/exported_program_translator.py”, line 279, in create_input_vars for node in exported_program.graph.find_nodes(op=“placeholder”, target=spec.target): AttributeError: ‘Graph’ object has no attribute ‘find_nodes’

I have strictly conformed to this End-to-End Optimize Model — tvm 0.20.dev0 documentation

Looks like you are facing issues from PyTorch, what’s the pytorch version you are using? And please upgrade Pytorch and try again :slight_smile:

thanks a lot! My print(torch.version) outputs ‘2.3.0+cu121’ . So i will try another version.

hello,siyuan! I have updated the latest torch and torchvision. However, when i’m running the quick start tutorial for e2e model optimization, ‘assertion error: unsupported function type batch_norm.default’ occurred. Is it still the version conflict between TVM and pytorch?

1 Like

Hi, Were you able to resolve the issue? I am facing the same Unsupported function type batch_norm.default problem.

not yet,bro. I have figured out the root function which incurred the error. The operator type of newest Pytotch had not been defined in the tvm/src/…code. So it may need a modification?