Update build.py (#692)

pull/724/head
Xinchen Liu 2023-04-05 09:07:49 +08:00 committed by GitHub
parent 39887a102e
commit 817c748e8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -8,7 +8,14 @@ import logging
import os
import torch
from torch._six import string_classes
TORCH_MAJOR = int(torch.__version__.split('.')[0])
TORCH_MINOR = int(torch.__version__.split('.')[1])
if TORCH_MAJOR == 1 and TORCH_MINOR < 8:
from torch._six import string_classes
else:
string_classes = str
from collections import Mapping
from fastreid.config import configurable