Update inference_img.py

This commit is contained in:
hzwer
2020-12-30 23:42:55 +08:00
committed by GitHub
parent a713984236
commit 85a3eafcb5

View File

@@ -8,8 +8,8 @@ import warnings
warnings.filterwarnings("ignore")
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
torch.set_grad_enabled(False)
if torch.cuda.is_available():
torch.set_grad_enabled(False)
torch.backends.cudnn.enabled = True
torch.backends.cudnn.benchmark = True