various additions for M1 GPU #299

Closed
Smiril wants to merge 80 commits from main into main
Showing only changes of commit c01d582b3f - Show all commits
+7 -1
View File
@@ -48,7 +48,13 @@ class fsModel(BaseModel):
torch.backends.cudnn.benchmark = True
self.isTrain = opt.isTrain
device = torch.device("cuda:0")
if not torch.backends.mps.is_available():
if not torch.backends.mps.is_built():
device = torch.device("cuda:0")
else:
print("ERROR")
else:
device = torch.device("mps")
if opt.crop_size == 224:
from .fs_networks import Generator_Adain_Upsample, Discriminator