未验证 提交 1dee0f76 编写于 作者: F Feng Wang 提交者: GitHub

fix(setup): cpp extension (#1254)

上级 6513f769
......@@ -8,6 +8,7 @@ import sys
TORCH_AVAILABLE = True
try:
import torch
from torch.utils import cpp_extension
except ImportError:
TORCH_AVAILABLE = False
print("[WARNING] Unable to import torch, pre-compiling ops will be disabled.")
......@@ -56,7 +57,7 @@ def get_ext_modules():
def get_cmd_class():
cmdclass = {}
if TORCH_AVAILABLE:
cmdclass["build_ext"] = torch.utils.cpp_extension.BuildExtension
cmdclass["build_ext"] = cpp_extension.BuildExtension
return cmdclass
......
......@@ -191,7 +191,7 @@ class COCODataset(Dataset):
img_file = os.path.join(self.data_dir, self.name, file_name)
img = cv2.imread(img_file)
assert img is not None
assert img is not None, f"file named {img_file} not found"
return img
......
......@@ -219,7 +219,7 @@ class VOCDetection(Dataset):
def load_image(self, index):
img_id = self.ids[index]
img = cv2.imread(self._imgpath % img_id, cv2.IMREAD_COLOR)
assert img is not None
assert img is not None, f"file named {self._imgpath % img_id} not found"
return img
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册