1 min readJan 23, 2019
Zhirui Feng If the model was built on CUDA, when you load on a CPU you use this:
torch.load(‘myfile.pth’, map_location=lambda storage, location: ‘cpu’)
Zhirui Feng If the model was built on CUDA, when you load on a CPU you use this:
torch.load(‘myfile.pth’, map_location=lambda storage, location: ‘cpu’)
AI researcher at CYNET.ai, writing about artificial intelligence, Python programming, machine learning, computer vision, robotics, natural language processing