fast-style-transfer
fast-style-transfer copied to clipboard
Error with --slow parameter
When using --slow parameter it shows an error message: "img" is not defined
File: style.py
String: save_img(preds_path, img)
There is no "img" variable in style.py
Yes. This was reported and ignored in #117.
I'm also getting the same issue, As @Yagun says, I'm not seeing img in style.py either, should there be a parameter passed along with the flag or something?
I checked #117 and it's reference to flake8, which is a linter from what I can see. With this, I can't see where my formatting for the training a new model would come from... I literally copied the example but with correct paths for my system and added --slow at the end of the command
python style.py --style path/to/style/img.jpg \
--checkpoint-dir checkpoint/path \
--test path/to/test/img.jpg \
--test-dir path/to/test/dir \
--content-weight 1.5e1 \
--checkpoint-iterations 1000 \
--batch-size 20
to
python style.py --style path/to/style/img.jpg \
--checkpoint-dir checkpoint/path \
--test path/to/test/img.jpg \
--test-dir path/to/test/dir \
--content-weight 1.5e1 \
--checkpoint-iterations 1000 \
--batch-size 20 \
--slow
Any suggestions or recommendations? Thanks!
I found a fix for this. Replace img with preds.reshape((512,512,3)), it should work then. It will give you a 512x512 output, if you want different resolutions, you can change the resolution in preds.reshape and in two other spots in src/optimize.py. Of course more sophisticated solutions are possible.