artyom-beilis / pytorch_dlprim

DLPrimitives/OpenCL out of tree backend for pytorch
http://blog.dlprimitives.org/
MIT License
227 stars 16 forks source link

Error with torch.save(model.state_dict(), sPath): don't know how to determine data location of torch.storage.UntypedStorage #61

Open sukamenev opened 4 months ago

sukamenev commented 4 months ago

torch.save(model.state_dict(), sFileName) File "/home/ineev/programming/ZenDnn/lib/python3.10/site-packages/torch/serialization.py", line 423, in save _save(obj, opened_zipfile, pickle_module, pickle_protocol) File "/home/ineev/programming/ZenDnn/lib/python3.10/site-packages/torch/serialization.py", line 635, in _save pickler.dump(obj) File "/home/ineev/programming/ZenDnn/lib/python3.10/site-packages/torch/serialization.py", line 620, in persistent_id location = location_tag(storage) File "/home/ineev/programming/ZenDnn/lib/python3.10/site-packages/torch/serialization.py", line 209, in location_tag raise RuntimeError("don't know how to determine data location of " RuntimeError: don't know how to determine data location of torch.storage.UntypedStorage

Error raised only when I'm using ocl-backend.

artyom-beilis commented 4 months ago

I don't know why this is happening. But I recall if I move the model to CPU it saves correctly.

I hadn't figured out yet why it fails.

sukamenev commented 4 months ago

Yes. Model on CPU saves correctly.

sukamenev commented 4 months ago

Do you have any idea what part of the code is wrong?