fast-style-transfer icon indicating copy to clipboard operation
fast-style-transfer copied to clipboard

Error with --slow parameter

Open Yagun opened this issue 7 years ago • 3 comments

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

Yagun avatar Jan 25 '18 17:01 Yagun

Yes. This was reported and ignored in #117.

cclauss avatar Jan 30 '18 14:01 cclauss

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!

jshaw avatar Feb 15 '18 22:02 jshaw

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.

mayerjRRR avatar May 02 '18 16:05 mayerjRRR