From 5d02026d61ed807205d92f1319f216f64519f49b Mon Sep 17 00:00:00 2001 From: Kraiwin Namsri Date: Mon, 19 Jun 2023 23:47:33 +0200 Subject: [PATCH] Explicitly added map_location To fix this: " 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. " --- demo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demo.py b/demo.py index a5eb382..bb95ade 100644 --- a/demo.py +++ b/demo.py @@ -147,7 +147,7 @@ def write_video_with_audio(audio_path, output_path, prefix='pred_'): config['model_params']['APC']['hidden_size'], config['model_params']['APC']['num_layers'], config['model_params']['APC']['residual']) - APC_model.load_state_dict(torch.load(config['model_params']['APC']['ckp_path']), strict=False) + APC_model.load_state_dict(torch.load(config['model_params']['APC']['ckp_path'], map_location=device), strict=False) if opt.device == 'cuda': APC_model.cuda() APC_model.eval()