mirror of
https://github.com/JDAI-CV/fast-reid.git
synced 2025-06-03 14:50:47 +08:00
refactor apex import
This commit is contained in:
parent
a53fd17874
commit
ef6ebf451b
@ -11,12 +11,17 @@ from typing import Optional, List, Dict, NamedTuple, Tuple, Iterable
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
import torch
|
import torch
|
||||||
import torch.nn as nn
|
import torch.nn as nn
|
||||||
from apex.parallel import DistributedDataParallel
|
|
||||||
from termcolor import colored
|
from termcolor import colored
|
||||||
from torch.nn.parallel import DataParallel
|
from torch.nn.parallel import DataParallel
|
||||||
|
|
||||||
from fastreid.utils.file_io import PathManager
|
from fastreid.utils.file_io import PathManager
|
||||||
|
|
||||||
|
try:
|
||||||
|
from apex.parallel import DistributedDataParallel
|
||||||
|
except ImportError:
|
||||||
|
raise ImportError("Please install apex from https://www.github.com/nvidia/apex to run this example if you want to"
|
||||||
|
"train with DDP")
|
||||||
|
|
||||||
|
|
||||||
class _IncompatibleKeys(
|
class _IncompatibleKeys(
|
||||||
NamedTuple(
|
NamedTuple(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user