I trained a model with GPU. I want to make an error when loading the test locally (only CPU):
raise RuntimeError('Attempting to deserialize object on a CUDA ' 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.
According to the prompt, add to torch. Load() map_ Location = torch. Device ('cpu ')
parameter
Similar Posts:
- [Solved] RuntimeError: Attempting to deserialize object on CUDA device 2 but torch.cuda.device_count() is 1
- Solutions to errors encountered by Python
- Input type (torch.FloatTensor) and weight type (torch.cuda.FloatTensor) should be the same
- [Solved] RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu!
- RuntimeError: cuda runtime error (30) : unknown errorr
- [Solved] torch.cuda.CudaError: CUDA driver version is insufficient for CUDA runtime version (35) [ WARN:0
- Runtimeerror: CUDA error: out of memory [How to Solve]
- InternalError: cudaGetDevice() failed. Status: CUDA driver version is insufficient for CUDA runti…
- [Solved] RuntimeError: Input type (torch.cuda.FloatTensor) and weight type (torch.FloatTensor) should be the same
- [Solved] module ‘keras.engine.topology’ has no attribute ‘load_weights_from_hdf5_group_by_name…