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

UnboundLocalError: local variable 'images' referenced before assignment #10

Closed
c1a1o1 opened this issue Feb 28, 2022 · 3 comments
Closed

Comments

@c1a1o1
Copy link

c1a1o1 commented Feb 28, 2022

F:\ProgramData\Anaconda3\python.exe F:/work/mingxingshipin/opencv_Real_Time_Image_Animation-master/e2style-main/scripts/inference.py
Inference: Results are from Stage1.
Loading E2Style from checkpoint: F:/work/mingxingshipin/opencv_Real_Time_Image_Animation-master/e2style-main/pretrained_models/sr.pt
Loading dataset for celebs_super_resolution
Performing down-sampling with factors: [1, 2, 4, 8, 16, 32]
0%| | 0/4 [00:25<?, ?it/s]
Traceback (most recent call last):
File "F:/work/mingxingshipin/opencv_Real_Time_Image_Animation-master/e2style-main/scripts/inference.py", line 120, in
run()
File "F:/work/mingxingshipin/opencv_Real_Time_Image_Animation-master/e2style-main/scripts/inference.py", line 77, in run
result_batch, latent_batch = net(input_cuda, randomize_noise=False, resize=opts.resize_outputs, return_latents=True)
File "F:\ProgramData\Anaconda3\lib\site-packages\torch\nn\modules\module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "..\models\e2style.py", line 100, in forward
return images, result_latent
UnboundLocalError: local variable 'images' referenced before assignment

@wty-ustc
Copy link
Owner

After seeing issue #11 , I believe you have solved the problem.

@c1a1o1
Copy link
Author

c1a1o1 commented Feb 28, 2022

Thanks very much!

@Dratlan
Copy link

Dratlan commented Nov 28, 2022

After seeing issue #11 , I believe you have solved the problem.

uhhh, I'm a little confused. Is that related to this? I solve this question by reset resize=true. By the way, why the output of super resolution always got 256*256(I didn't choose the --resize_outputs)

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