Skip to content
ProGamerGov edited this page Jul 13, 2017 · 43 revisions

Basic Neural-Style Commands:


  • The -init parameter is by default set to random, though from what I have seen, most people get better results by setting it to image.

  • I would also suggest using a -seed value of your choice, or a random value. The -seed value will let you run the exact same command again, to create the exact same image. This is useful for experimenting with parameters, while ruling out changes due to the default random -seed value that Neural-Style uses.

  • The -save_iter can be used to monitor the progress of Neural-Style, and to make sure your chosen parameters are working. By default, the -save_iter command is set to output an image every 100 iterations, though I have found that setting it to output an image every 50 iterations works better for debugging.

  • The final output image doesn't have to be your chosen artwork piece to share. By using the -save_iter command effectively, you can end up with many different variations of your output image saved at different iterations. For example, I had a nice output image that looked the best at 50 iterations, and at 400 iterations, so while the two images are a bit different, I kept them both to share.

  • An interesting Neural-Style phenomenon is increasing or decreasing both content and style weight so that their ratio stays the same. Many of us know that doing that gives different results. Higher absolute weights results in higher loss which gives higher gradients which again result in larger changes per iteration (similar to a higher learning rate). Source

  • Rotating either your style or content image, will change the output image that Neural-Style produces.

  • Having the same style image multiple times like for example: -style_image style1.png,style1.png,style2.png, will also change the output image, as you are adjusting the style blend weights in a different way than how the -style_blend_weights command adjusts the blending weights.


Content And Style Image:


  • Neural-Style uses a neural network to perform artistic style transfer, and as such it's easier to think of it as an AI (though neural networks are not AI and are seen as a stepping stone towards to creation of real AI). This means that in addition to your chosen parameters, the model (AI brain) you are using will affect the abilities of Neural-Style. This also means that the lighting, details, and other aspects of an image, will affect Neural-Style as well.

  • Neural-Style does not understand what "image quality" is. This means that using a low quality or low resolution style image will result in a blurry output image.


Troubleshooting:

If you end up getting loss values appearing as nan or inf, you can try changing the -image_size value ever so slightly to resolve the issue.


Scripts:


  • Neural-Style scripts are essentially add-ons for Neural-Style. Though in some cases, they are actual modifications of the Neural-Style code, instead of new ways to use the normal code.