import torch.nn.functional as F | import torch.nn.functional as F | ||||
import torchvision | import torchvision | ||||
from utils.general import LOGGER | |||||
try: | try: | ||||
import thop # for FLOPs computation | import thop # for FLOPs computation | ||||
except ImportError: | except ImportError: | ||||
thop = None | thop = None | ||||
LOGGER = logging.getLogger(__name__) | |||||
@contextmanager | @contextmanager | ||||
def torch_distributed_zero_first(local_rank: int): | def torch_distributed_zero_first(local_rank: int): |