Phil
08/24/2023, 9:27 PMnf2 = NeuralForecast.load(path='../cluster_results/results/b79f6fd0c50099a7519da800805bf436d4f4f4a6/')
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'm trying to debug this error on my own. I found this stackoverflow post. https://stackoverflow.com/questions/56369030/runtimeerror-attempting-to-deserialize-object-on-a-cuda-device
But I think this needs to be handle as part of the load function?https://github.com/Nixtla/neuralforecast/blob/1d78f503ac4cd0fdfa7aae9156a876fe94eb1db4/neuralforecast/core.py#L665
I think this can be solved if you have an extra argument to the load function map_location
MODEL_FILENAME_DICT[model_name].load_from_checkpoint(f"{path}/{model}", map_location=map_location)
If I specify map_location=torch.device('cpu'))
, it worksJosé Morales
08/24/2023, 11:46 PMPhil
08/25/2023, 3:45 PMJosé Morales
08/25/2023, 4:07 PMPhil
08/25/2023, 11:32 PMPhil
08/29/2023, 4:34 PMJosé Morales
08/29/2023, 4:35 PMPhil
08/29/2023, 4:52 PMJosé Morales
08/29/2023, 5:52 PM