diff --git a/modelscope/pipelines/cv/skin_retouching_pipeline.py b/modelscope/pipelines/cv/skin_retouching_pipeline.py index 056409df..d9b49ff3 100644 --- a/modelscope/pipelines/cv/skin_retouching_pipeline.py +++ b/modelscope/pipelines/cv/skin_retouching_pipeline.py @@ -44,8 +44,10 @@ class SkinRetouchingPipeline(Pipeline): """ super().__init__(model=model) - if device == 'gpu': + if torch.cuda.is_available() and device == 'gpu': device = 'cuda' + else: + device = 'cpu' model_path = os.path.join(self.model, ModelFile.TORCH_MODEL_FILE) detector_model_path = os.path.join( self.model, 'retinaface_resnet50_2020-07-20_old_torch.pth')