This repository was archived by the owner on Apr 17, 2023. It is now read-only.
This repository was archived by the owner on Apr 17, 2023. It is now read-only.
Inspirational generation #121
Open
Description
Hi @Molugan , thank you for this great repo!
I have trained the stylegan using my own dataset and tried to do the inspirational generation following your instruction. I have conducted
python save_feature_extractor.py vgg19 feature_extractor_345 --layers 3 4 5
And then run
python eval.py inspirational_generation -n stylegan_outdoor -m StyleGAN --input_image fake_data_outdoor/gen_0.jpg -f feature_extractor_345
Yet I got error as following:
0 : 56.091831
Traceback (most recent call last):
File "eval.py", line 54, in <module>
out = module.test(parser, visualisation=vis_module)
File "/models/eval/inspirational_generation.py", line 429, in test
outPathSave=outPathDescent)
File "/models/eval/inspirational_generation.py", line 258, in gradientDescentOnInput
loss.sum(dim=0).backward(retain_graph=retainGraph)
File "/.virtualenvs/cv/lib/python3.6/site-packages/torch/tensor.py", line 198, in backward
torch.autograd.backward(self, gradient, retain_graph, create_graph)
File "/.virtualenvs/cv/lib/python3.6/site-packages/torch/autograd/__init__.py", line 100, in backward
allow_unreachable=True) # allow_unreachable flag
RuntimeError: Trying to backward through the graph a second time, but the buffers have already been freed. Specify retain_graph=True when calling backward the first time.
Besides, there might be a typo in the readme file, as the command should be
--input_image $pathTotheInputImage
instead of
--inputImage $pathTotheInputImage
Any insights on how to solve the RuntimeError issue? Any help would be greatly appreciated!
Metadata
Metadata
Assignees
Labels
No labels