You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Went through this code path when attempting to load my own saved checkpoint, and kept getting an EOF error until I inserted a rewind, opened_file.seek(0) before the torch.load (linked above).
This is because the try...except block has a (different) load in the try part, so if it falls back to the exception handler the file-handle is not necessarily at the beginning of the file, and therefore it is not valid to try to load from the file-handle again as-is. It is possible that it would be better to separate the exception handling for file errors from the exception handling for 'jit loading problems', or maybe even better not to try to load with the jit module when the jit option is False, but I'll leave that to you to decide.
Note that I have since switched to loading the ViT-B32 model and then replacing the state_dict, so I don't trigger this bug in my own code anymore.
The text was updated successfully, but these errors were encountered:
CLIP/clip/clip.py
Line 136 in a1d0717
Went through this code path when attempting to load my own saved checkpoint, and kept getting an EOF error until I inserted a rewind,
opened_file.seek(0)
before thetorch.load
(linked above).This is because the
try...except
block has a (different)load
in thetry
part, so if it falls back to the exception handler the file-handle is not necessarily at the beginning of the file, and therefore it is not valid to try to load from the file-handle again as-is. It is possible that it would be better to separate the exception handling for file errors from the exception handling for 'jit loading problems', or maybe even better not to try to load with the jit module when the jit option is False, but I'll leave that to you to decide.Note that I have since switched to loading the ViT-B32 model and then replacing the state_dict, so I don't trigger this bug in my own code anymore.
The text was updated successfully, but these errors were encountered: