Skip to content

Commit

Permalink
Fix imagenet_scaling not used
Browse files Browse the repository at this point in the history
  • Loading branch information
Eve-ning committed Feb 21, 2024
1 parent b74c406 commit 9d95948
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/frdc/models/inceptionv3.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def __init__(
sharpen_temp=0.5,
mix_beta_alpha=0.75,
)
self.imagenet_scaling = imagenet_scaling

self.inception = inception_v3(
weights=Inception_V3_Weights.IMAGENET1K_V1,
Expand Down Expand Up @@ -136,7 +137,7 @@ def adapt_inception_multi_channel(
return inception

@staticmethod
def imagenet_scaling(x: torch.Tensor) -> torch.Tensor:
def _imagenet_scaling(x: torch.Tensor) -> torch.Tensor:
"""Perform adapted ImageNet normalization on the input tensor.
See Also:
Expand Down Expand Up @@ -189,7 +190,7 @@ def forward(self, x: torch.Tensor):
)

if self.imagenet_scaling:
x = self.imagenet_scaling(x)
x = self._imagenet_scaling(x)

# During training, the auxiliary outputs are used for auxiliary loss,
# but during testing, only the main output is used.
Expand Down

0 comments on commit 9d95948

Please sign in to comment.