tamarott / SinGAN

Official pytorch implementation of the paper: "SinGAN: Learning a Generative Model from a Single Natural Image"
https://tamarott.github.io/SinGAN.htm
Other
3.31k stars 611 forks source link

Cannot generate Random Samples #54

Closed Auth0rM0rgan closed 4 years ago

Auth0rM0rgan commented 4 years ago

Hey @tamarott ,

Great job and thanks for sharing your code, I've followed the instruction in the readme file to train the model and I have trained the model with default values for 8 scales and 2000 iterations for my own image but when I'm trying to generate the Random Sample, I'm getting this error.

Traceback (most recent call last): File "random_samples.py", line 40, in Gs, Zs, reals, NoiseAmp = functions.load_trained_pyramid(opt) File "/home/armin/Desktop/SinGAN/SinGAN/functions.py", line 245, in load_trained_pyramid return Gs,Zs,reals,NoiseAmp UnboundLocalError: local variable 'Gs' referenced before assignment

Do you know why I'm facing this error?!

Thanks,

tamarott commented 4 years ago

Hi, Did you checked that the input image name in both cases is the same? Seems like there is no trained model for this image. You can go to the "Trained Model" folder to try to sort this out.

Auth0rM0rgan commented 4 years ago

Hi, Thanks for your help. I've found my mistake!