mirror of
https://github.com/invoke-ai/InvokeAI
synced 2026-03-30 11:35:07 +02:00
catch RunTimeError during model to() call rather than OutOfMemoryError
This commit is contained in:
parent
dedf0c6ffa
commit
46d23cd868
@ -273,7 +273,7 @@ class ModelCache(ModelCacheBase[AnyModel]):
|
||||
snapshot_before = self._capture_memory_snapshot()
|
||||
try:
|
||||
cache_entry.model.to(target_device)
|
||||
except torch.cuda.OutOfMemoryError as e: # blow away cache entry
|
||||
except RuntimeError as e: # blow away cache entry
|
||||
self._delete_cache_entry(cache_entry)
|
||||
raise e
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user