Skip to content

TorchScript can't work for AHNet when num_psp=0 #1478

@Nic-Ma

Description

@Nic-Ma

Describe the bug
When set num_psp=0 in AHNet, can't use TorchScript to export the model:

RuntimeError: 
Module 'AHNet' has no attribute 'psp' :
  File "/workspace/data/medical/MONAI/monai/networks/nets/ahnet.py", line 514
        d4 = self.dense4(sum4)
        if self.psp_block_num > 0:
            psp = self.psp(d4)
                  ~~~~~~~~ <--- HERE
            x = torch.cat((psp, d4), dim=1)
        else:

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions