carpedm20 / DCGAN-tensorflow

A tensorflow implementation of "Deep Convolutional Generative Adversarial Networks"
http://carpedm20.github.io/faces/
MIT License
7.16k stars 2.62k forks source link

Bug when training with celebA:UnboundLocalError: local variable 'im' referenced before assignment #365

Open xuxiangsun opened 5 years ago

xuxiangsun commented 5 years ago

Hey guys, i was stuck in such bug :"UnboundLocalError: local variable 'im' referenced before assignment" when i train the code with celebA. Need Help!

xuxiangsun commented 5 years ago

@carpedm20 Sir, i find that your code may not define 'im' in transform and center_crop function of utils.py. Can you help me?

koujiaodong commented 4 years ago

In utils.py 105:return np.array(im.resize([resize_h, resize_w]), PIL.Image.BILINEAR)/127.5 - 1. Change to:cropped_image/127.5 - 1.