Skip to content

Commit 817c748

Browse files
authored
Update build.py (#692)
1 parent 39887a1 commit 817c748

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

fastreid/data/build.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,14 @@
88
import os
99

1010
import torch
11-
from torch._six import string_classes
11+
TORCH_MAJOR = int(torch.__version__.split('.')[0])
12+
TORCH_MINOR = int(torch.__version__.split('.')[1])
13+
14+
if TORCH_MAJOR == 1 and TORCH_MINOR < 8:
15+
from torch._six import string_classes
16+
else:
17+
string_classes = str
18+
1219
from collections import Mapping
1320

1421
from fastreid.config import configurable

0 commit comments

Comments
 (0)