BiomedSciAI/histocartography

Torch version issue

Ramxnan opened this issue · 2 comments

Im trying to run own .pth model instead but my model is based off the recent torch version and does not work in 1.10.1 which is needed by nuclei_detection. is there a way to overcome the "AttributeError: 'Upsample' object has no attribute 'recompute_scale_factor'" without downgrading the torch package?

Pytorch has changed its API. As a quick fix you can change to:

    def forward(self, x):
        # x = self.upsample(x)
        x = F.upsample(x, scale_factor=2, mode='nearest')
        return x

in histocartography/ml/models/hovernet.py

Thank you!