深度学习以CPU方式读入模型参数

state_dict=torch.load('../train-output/'+ args.model_name_or_path.split('/')[-1] +'/unet/diffusion_pytorch_model.bin', map_location='cpu')
    # state_dict=torch.load('../train-output/'+ 
args.model_name_or_path.split('/')[-1] +'/unet/diffusion_pytorch_model.bin')

state_dict=torch.load('../train-output/'+ args.model_name_or_path.split('/')[-1] +'/unet/diffusion_pytorch_model.bin', map_location='cpu')
 state_dict=torch.load('../train-output/'+ args.model_name_or_path.split('/')[-1] +'/unet/diffusion_pytorch_model.bin')

你可能感兴趣的:(深度学习,人工智能)