SRGAN-tensorflow icon indicating copy to clipboard operation
SRGAN-tensorflow copied to clipboard

Issue training SRGAN with perceptual loss

Open owenqyzhang opened this issue 7 years ago • 5 comments
trafficstars

Hi, I got this issue while training SRGAN with perceptual loss

Traceback (most recent call last): File "main.py", line 231, in Net = SRGAN(data.inputs, data.targets, FLAGS) File ".../SRGAN-tensorflow/lib/model.py", line 372, in SRGAN extracted_feature_gen = VGG19_slim(gen_output, FLAGS.perceptual_mode, reuse=False, scope=scope) File ".../SRGAN-tensorflow/lib/model.py", line 341, in VGG19_slim output = output[target_layer] KeyError: 'vgg19_1/vgg_19/conv5/conv5_4'

owenqyzhang avatar Dec 02 '17 23:12 owenqyzhang

It seemed that I can't not reproduce the problem you encountered. Can you use pdb or ipdb to break at model.py line 341 and check what's inside variable "output"?

brade31919 avatar Dec 06 '17 09:12 brade31919

In the debugger, keys in 'output' are 'vgg_19/conv5/conv5_4' instead of 'vgg_19_1/vgg_19/conv5/conv5_4'. I changed line 335 and 337 to target_layer = 'vgg_19/conv5/conv5_4' and target_layer = 'vgg_19/conv2/conv2_2' respectively and solved the problem. Not sure what caused the problem though.

owenqyzhang avatar Dec 06 '17 16:12 owenqyzhang

Reinstall tensorflow tensorflow-gpu

geekan avatar Dec 21 '17 08:12 geekan

I got the same error, how did you solve it?

youthM avatar Apr 11 '18 08:04 youthM

Go to this commit in pull request: https://github.com/brade31919/SRGAN-tensorflow/pull/37/commits/61d0c25ae0ff298ab00f8ab324414073beb38b87 Thanks @ryancom16

harsh306 avatar Jun 12 '18 23:06 harsh306