diff --git a/holocron/utils/data/collate.py b/holocron/utils/data/collate.py index 605d40c86..2e820eaba 100644 --- a/holocron/utils/data/collate.py +++ b/holocron/utils/data/collate.py @@ -3,7 +3,7 @@ # This program is licensed under the Apache License version 2. # See LICENSE or go to for full license details. -from typing import List, Tuple +from typing import Tuple import numpy as np import torch diff --git a/references/segmentation/transforms.py b/references/segmentation/transforms.py index 9df3cf4e6..62960a097 100644 --- a/references/segmentation/transforms.py +++ b/references/segmentation/transforms.py @@ -77,7 +77,6 @@ def __init__(self, prob): def __call__(self, image, target): if random.random() < self.prob: - _, width = image.size image = F.hflip(image) # Flip the segmentation target = F.hflip(target) diff --git a/scripts/eval_latency.py b/scripts/eval_latency.py index 55a07d08e..d0fb798ee 100644 --- a/scripts/eval_latency.py +++ b/scripts/eval_latency.py @@ -36,8 +36,7 @@ def main(args): # Warmup for _ in range(10): - with torch.no_grad(): - _ = model(img_tensor) + _ = model(img_tensor) timings = [] diff --git a/tests/test_nn_loss.py b/tests/test_nn_loss.py index f4be645f5..24112bc2a 100644 --- a/tests/test_nn_loss.py +++ b/tests/test_nn_loss.py @@ -1,6 +1,6 @@ import torch from torch.nn import CrossEntropyLoss, Linear -from torch.nn.functional import cross_entropy, log_softmax +from torch.nn.functional import cross_entropy from holocron import nn from holocron.nn import functional as F diff --git a/tests/test_requirements.py b/tests/test_requirements.py index 045ac723f..2c721d095 100644 --- a/tests/test_requirements.py +++ b/tests/test_requirements.py @@ -1,5 +1,4 @@ import re -from datetime import datetime from pathlib import Path