Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用现有模型,测试,返回错误,如何解决? #8

Open
fishboyzyf opened this issue Jan 28, 2023 · 2 comments
Open

使用现有模型,测试,返回错误,如何解决? #8

fishboyzyf opened this issue Jan 28, 2023 · 2 comments

Comments

@fishboyzyf
Copy link

python.exe D:\develop\DifFace\inference_difface.py --in_path D:\develop\DifFace\testdata\whole_imgs --out_path D:\data --gpu_id 0
Setting random seed 20000
Loading from ./weights/diffusion/iddpm_ffhq512_ema500000.pth...
Loaded Done
C:\Users***\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\functional.py:504: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\native\TensorShape.cpp:3191.)
return _VF.meshgrid(tensors, kwargs) # type: ignore[attr-defined]
Loading from ./weights/SwinIR/General_Face_ffhq512.pth...
Loaded Done
C:\Users*****\AppData\Local\Programs\Python\Python39\lib\site-packages\torchvision\models_utils.py:208: UserWarning: The parameter 'pretrained' is deprecated since 0.13 and may be removed in the future, please use 'weights' instead.
warnings.warn(
C:\Users*
\AppData\Local\Programs\Python\Python39\lib\site-packages\torchvision\models_utils.py:223: UserWarning: Arguments other than a weight enum or None for 'weights' are deprecated since 0.13 and may be removed in the future. The current behavior is equivalent to passing weights=None.
warnings.warn(msg)
Traceback (most recent call last):
File "D:\develop\DifFace\inference_difface.py", line 160, in
main()
File "D:\develop\DifFace\inference_difface.py", line 137, in main
image_restored, face_restored, face_cropped = sampler_dist.sample_func_bfr_unaligned(
File "D:\develop\DifFace\sampler.py", line 368, in sample_func_bfr_unaligned
restored_faces = _process_batch(self.face_helper.cropped_faces)
File "D:\develop\DifFace\sampler.py", line 332, in _process_batch
restored_faces = self.sample_func_ir_aligned(
File "D:\develop\DifFace\sampler.py", line 279, in sample_func_ir_aligned
sample = self.diffusion.p_sample_loop(
File "D:\develop\DifFace\models\gaussian_diffusion.py", line 428, in p_sample_loop
for sample in self.p_sample_loop_progressive(
File "D:\develop\DifFace\models\gaussian_diffusion.py", line 484, in p_sample_loop_progressive
out = self.p_sample(
File "D:\develop\DifFace\models\gaussian_diffusion.py", line 383, in p_sample
out = self.p_mean_variance(
File "D:\develop\DifFace\models\respace.py", line 88, in p_mean_variance
return super().p_mean_variance(self._wrap_model(model), *args, **kwargs)
File "D:\develop\DifFace\models\gaussian_diffusion.py", line 278, in p_mean_variance
min_log = _extract_into_tensor(
File "D:\develop\DifFace\models\gaussian_diffusion.py", line 105, in _extract_into_tensor
res = th.from_numpy(arr).to(device=timesteps.device)[timesteps].float()
KeyboardInterrupt

@chensming
Copy link

python.exe D:\develop\DifFace\inference_difface.py --in_path D:\develop\DifFace\testdata\whole_imgs --out_path D:\data --gpu_id 0 Setting random seed 20000 Loading from ./weights/diffusion/iddpm_ffhq512_ema500000.pth... Loaded Done C:\Users***\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\functional.py:504: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\native\TensorShape.cpp:3191.) return _VF.meshgrid(tensors, kwargs) # type: ignore[attr-defined] Loading from ./weights/SwinIR/General_Face_ffhq512.pth... Loaded Done C:\Users***\AppData\Local\Programs\Python\Python39\lib\site-packages\torchvision\models_utils.py:208: UserWarning: The parameter 'pretrained' is deprecated since 0.13 and may be removed in the future, please use 'weights' instead. warnings.warn( C:\Users***\AppData\Local\Programs\Python\Python39\lib\site-packages\torchvision\models_utils.py:223: UserWarning: Arguments other than a weight enum or None for 'weights' are deprecated since 0.13 and may be removed in the future. The current behavior is equivalent to passing weights=None. warnings.warn(msg) Traceback (most recent call last): File "D:\develop\DifFace\inference_difface.py", line 160, in main() File "D:\develop\DifFace\inference_difface.py", line 137, in main image_restored, face_restored, face_cropped = sampler_dist.sample_func_bfr_unaligned( File "D:\develop\DifFace\sampler.py", line 368, in sample_func_bfr_unaligned restored_faces = _process_batch(self.face_helper.cropped_faces) File "D:\develop\DifFace\sampler.py", line 332, in _process_batch restored_faces = self.sample_func_ir_aligned( File "D:\develop\DifFace\sampler.py", line 279, in sample_func_ir_aligned sample = self.diffusion.p_sample_loop( File "D:\develop\DifFace\models\gaussian_diffusion.py", line 428, in p_sample_loop for sample in self.p_sample_loop_progressive( File "D:\develop\DifFace\models\gaussian_diffusion.py", line 484, in p_sample_loop_progressive out = self.p_sample( File "D:\develop\DifFace\models\gaussian_diffusion.py", line 383, in p_sample out = self.p_mean_variance( File "D:\develop\DifFace\models\respace.py", line 88, in p_mean_variance return super().p_mean_variance(self._wrap_model(model), *args, **kwargs) File "D:\develop\DifFace\models\gaussian_diffusion.py", line 278, in p_mean_variance min_log = _extract_into_tensor( File "D:\develop\DifFace\models\gaussian_diffusion.py", line 105, in _extract_into_tensor res = th.from_numpy(arr).to(device=timesteps.device)[timesteps].float() KeyboardInterrupt

hi, bro, where did you download the ckpts?

@zsyOAOA
Copy link
Owner

zsyOAOA commented May 19, 2023

Would you please share one of your testing images via email of zsyzam@gmail.com? I will have a try. The testing code runs normally on my testing environment. @fishboyzyf @chensming

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants