aigc-apps / EasyPhoto

📷 EasyPhoto | Your Smart AI Photo Generator. Without Stable-Diffusion-Webui
Apache License 2.0
265 stars 36 forks source link

Start Generation RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:1 and cuda:0 #7

Closed Aruen24 closed 1 year ago

Aruen24 commented 1 year ago

Traceback (most recent call last): File "D:\soft\Miniconda\envs\facechain\lib\site-packages\gradio\routes.py", line 488, in run_predict output = await app.get_blocks().process_api( File "D:\soft\Miniconda\envs\facechain\lib\site-packages\gradio\blocks.py", line 1431, in process_api result = await self.call_function( File "D:\soft\Miniconda\envs\facechain\lib\site-packages\gradio\blocks.py", line 1109, in call_function prediction = await anyio.to_thread.run_sync( File "D:\soft\Miniconda\envs\facechain\lib\site-packages\anyio\to_thread.py", line 33, in run_sync return await get_asynclib().run_sync_in_worker_thread( File "D:\soft\Miniconda\envs\facechain\lib\site-packages\anyio_backends_asyncio.py", line 877, in run_sync_in_worker_thread return await future File "D:\soft\Miniconda\envs\facechain\lib\site-packages\anyio_backends_asyncio.py", line 807, in run result = context.run(func, args) File "D:\soft\Miniconda\envs\facechain\lib\site-packages\gradio\utils.py", line 706, in wrapper response = f(args, *kwargs) File "E:\PyCharmProject\EasyPhoto\easyphoto\easyphoto_infer.py", line 385, in easyphoto_infer_forward fusion_image = image_face_fusion(dict(template=input_image, user=roop_images[index]))[OutputKeys.OUTPUT_IMG] # swap_face(target_img=output_image, source_img=roop_image, model="inswapper_128.onnx", upscale_options=UpscaleOptions()) File "D:\soft\Miniconda\envs\facechain\lib\site-packages\modelscope\pipelines\base.py", line 219, in call output = self._process_single(input, args, kwargs) File "D:\soft\Miniconda\envs\facechain\lib\site-packages\modelscope\pipelines\base.py", line 254, in _process_single out = self.forward(out, forward_params) File "D:\soft\Miniconda\envs\facechain\lib\site-packages\modelscope\pipelines\cv\image_face_fusion_pipeline.py", line 62, in forward output = self.model.inference(template_img, user_img) File "D:\soft\Miniconda\envs\facechain\lib\site-packages\modelscope\models\cv\image_face_fusion\image_facefusion.py", line 243, in inference mask = warp_affine_torch(self.mask, trans_inv, (ori_h, ori_w)) File "D:\soft\Miniconda\envs\facechain\lib\site-packages\modelscope\models\cv\image_face_fusion\network\ops.py", line 206, in warp_affine_torch return F.grid_sample( File "D:\soft\Miniconda\envs\facechain\lib\site-packages\torch\nn\functional.py", line 4244, in grid_sample return torch.grid_sampler(input, grid, mode_enum, padding_mode_enum, align_corners) RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:1 and cuda:0! (when checking argument for argument grid in method wrapper_CUDA__cudnn_grid_sampler)

Aruen24 commented 1 year ago

环境问题,pip install requirements.txt后正常