fix multiple read.

This commit is contained in:
Exusial 2022-08-27 11:11:22 +08:00
parent e58e0d2247
commit b6c9421a9a
1 changed files with 3 additions and 1 deletions

View File

@ -207,7 +207,9 @@ def persistent_load_direct(saved_id):
raise RuntimeError("Unknown saved id type: %s" % saved_id[0])
def load_pytorch(fn_name):
global contents, deserialized_objects
global contents, deserialized_objects, loaded_storages
loaded_storages = {}
deserialized_objects = {}
if not fn_name.endswith(".pth"):
print("This function is designed to load pytorch pth format files.")
return None