ThereforeGames / txt2mask

Automatically create masks for Stable Diffusion inpainting using natural language.
512 stars 40 forks source link

Non CUDA error? #18

Open enzyme69 opened 1 year ago

enzyme69 commented 1 year ago

I am using Mac M1 machine, probably non CUDA, and getting error when using txt2mask script:

RuntimeError: Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False. If you are running on a CPU-only machine, please use torch.load with map_location=torch.device('cpu') to map your storages to the CPU.
Time taken: 1m 18.08s
BaptisteGarcin commented 1 year ago

same, running on M1 Mac

theesfeld commented 1 year ago

line 124 in txt2mask.py:

model.load_state_dict(torch.load(d64_file, map_location=torch.device('cuda')), strict=False);

change cuda to cpu

ride5k commented 1 year ago

line 124 in txt2mask.py:

model.load_state_dict(torch.load(d64_file, map_location=torch.device('cuda')), strict=False);

change cuda to cpu

this worked for me too... kudos!