I tried moving an h5 file from JURECA to my machine, but the data on JURECA had been on the GPU, and my (nVidia-free) computer complained
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.
I believe the fix is to call .cpu() inside the TorchStrategy.write method. But if we do that then when we read it back presumably it will be on the cpu! So we should also modify the TorchStrategy.read to send the read data to the default device.
I tried moving an h5 file from JURECA to my machine, but the data on JURECA had been on the GPU, and my (nVidia-free) computer complained
I believe the fix is to call
.cpu()
inside theTorchStrategy.write
method. But if we do that then when we read it back presumably it will be on the cpu! So we should also modify theTorchStrategy.read
to send the read data to the default device.