Skip to content

Commit

Permalink
Fix statistic collection error for TileClassifier (#2088)
Browse files Browse the repository at this point in the history
Disable NNCF tracing in Tile Classifier sigmoid layer
  • Loading branch information
cih9088 authored Apr 28, 2023
1 parent 6ad7b60 commit 63d9d7a
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from torch import nn

from otx.algorithms.common.adapters.mmdeploy import is_mmdeploy_enabled
from otx.algorithms.common.adapters.nncf import no_nncf_trace

from .custom_maskrcnn_detector import CustomMaskRCNN

Expand Down Expand Up @@ -82,7 +83,10 @@ def simple_test(self, img: torch.Tensor) -> torch.Tensor:
Returns:
torch.Tensor: objectness score
"""
return self.sigmoid(self.forward(img))[0][0]

out = self.forward(img)
with no_nncf_trace():
return self.sigmoid(out)[0][0]


# pylint: disable=too-many-ancestors
Expand Down

0 comments on commit 63d9d7a

Please sign in to comment.