Incompatibility: AMD Graphics Cards Do Not Work
system3600 opened this issue · 2 comments
Exception :
An exception occurred while trying to process the frame: 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.
Log :
Traceback (most recent call last):
File "C:\Users\Administrator\Desktop\SD\stable-diffusion-webui-directml\extensions\SD-CN-Animation-c3c0972c0a3a2697533f662ab2e9cb24413fbd0c\scripts\base_ui.py", line 140, in process
yield from vid2vid.start_process(*args)
File "C:\Users\Administrator\Desktop\SD\stable-diffusion-webui-directml\extensions\SD-CN-Animation-c3c0972c0a3a2697533f662ab2e9cb24413fbd0c\scripts\core\vid2vid.py", line 149, in start_process
next_flow, prev_flow, occlusion_mask = RAFT_estimate_flow(prev_frame, curr_frame, device=device)
File "C:\Users\Administrator\Desktop\SD\stable-diffusion-webui-directml\extensions\SD-CN-Animation-c3c0972c0a3a2697533f662ab2e9cb24413fbd0c\scripts\core\flow_utils.py", line 55, in RAFT_estimate_flow
RAFT_model.load_state_dict(torch.load(args.model))
File "C:\Users\Administrator\Desktop\SD\stable-diffusion-webui-directml\modules\safe.py", line 107, in load
return load_with_extra(filename, *args, extra_handler=global_extra_handler, **kwargs)
File "C:\Users\Administrator\Desktop\SD\stable-diffusion-webui-directml\modules\safe.py", line 152, in load_with_extra
return unsafe_torch_load(filename, *args, **kwargs)
File "C:\Users\Administrator\Desktop\SD\stable-diffusion-webui-directml\venv\lib\site-packages\torch\serialization.py", line 809, in load
return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args)
File "C:\Users\Administrator\Desktop\SD\stable-diffusion-webui-directml\venv\lib\site-packages\torch\serialization.py", line 1172, in _load
result = unpickler.load()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\pickle.py", line 1213, in load
dispatchkey[0]
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\pickle.py", line 1254, in load_binpersid
self.append(self.persistent_load(pid))
File "C:\Users\Administrator\Desktop\SD\stable-diffusion-webui-directml\venv\lib\site-packages\torch\serialization.py", line 1142, in persistent_load
typed_storage = load_tensor(dtype, nbytes, key, _maybe_decode_ascii(location))
File "C:\Users\Administrator\Desktop\SD\stable-diffusion-webui-directml\venv\lib\site-packages\torch\serialization.py", line 1116, in load_tensor
wrap_storage=restore_location(storage, location),
File "C:\Users\Administrator\Desktop\SD\stable-diffusion-webui-directml\venv\lib\site-packages\torch\serialization.py", line 217, in default_restore_location
result = fn(storage, location)
File "C:\Users\Administrator\Desktop\SD\stable-diffusion-webui-directml\venv\lib\site-packages\torch\serialization.py", line 182, in _cuda_deserialize
device = validate_cuda_device(location)
File "C:\Users\Administrator\Desktop\SD\stable-diffusion-webui-directml\venv\lib\site-packages\torch\serialization.py", line 166, in validate_cuda_device
raise RuntimeError('Attempting to deserialize object on a CUDA '
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.
AMD video cards do not work with SD-CN-Animation, not even in CPU mode works, a possible solution would be to add support for Directml, or make a patch that ignores the CUDA error and proceed with the generation.
From what I've seen many people are with the same error, if anyone can solve please post the solution here :)
I'm running on Apple M1, and SD-CN worked well for me 8 days ago before the most recent update. There's clearly a solution, as we already had it in the previous version.