Skip to content
This repository has been archived by the owner on Mar 12, 2024. It is now read-only.

Update misc.py for torchvision 0.10.0 #404

Merged
merged 3 commits into from Jun 30, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions util/misc.py
Expand Up @@ -18,7 +18,7 @@

# needed due to empty tensor bug in pytorch and torchvision 0.5
import torchvision
if float(torchvision.__version__[:3]) < 0.7:
if float(torchvision.__version__.split(".")[1]) < 7.0:
from torchvision.ops import _new_empty_tensor
from torchvision.ops.misc import _output_size

Expand Down Expand Up @@ -454,7 +454,7 @@ def interpolate(input, size=None, scale_factor=None, mode="nearest", align_corne
This will eventually be supported natively by PyTorch, and this
class can go away.
"""
if float(torchvision.__version__[:3]) < 0.7:
if float(torchvision.__version__.split(".")[1]) < 7.0:
if input.numel() > 0:
return torch.nn.functional.interpolate(
input, size, scale_factor, mode, align_corners
Expand Down