Skip to content

Transitioning From neural style to neural style pt

ProGamerGov edited this page Dec 1, 2019 · 4 revisions

Transitioning From neural-style to neural-style-pt


While neural-style-pt is very similar to the original neural-style, there are some differences that you may have to take into account:

  • The -multigpu_strategy parameter was renamed to -multidevice_strategy. This change reflects PyTorch's ability to you any combination of CPUs and GPUs as devices.

  • The -backend parameter now has CPU backends (mkl, openmp) in addition to the cudnn backend. The clnn backend is no longer required as non Nvidia GPUs use software to convert Nvidia backends to their format.

  • The TVLoss features works a bit differently and thus will create a more "smooth" rather than blurry effect on output images.

  • The -normalize_gradients parameter has thus far not replicated, though you can use -content_weight 0 to achieve a similar effect.

  • The -style_image parameter is capable of loading all the images in a folder. You can use any combination of images and image directories/folders as long as they are separated by a comma. Ex: -style_image style1.jpg,styles_folder,style2.png,art_dir, where styles_folder and art_dir contain style images(s).

  • The -gpu parameter now reads the character c as the cpu instead of -1.

  • The -proto_file parameter has been completely removed. Model layers and architecture are now determined based on the model's name. You can find compatible models here.

  • A new -normalize_weights parameter has been added. Based on a feature from NeuralImageSynthesis.

For model names:

For multiscale generation scripts:

  • You will have to change the th interpreter to python or python3.

  • neural_style.lua will need the .lua extension changed to Python's .py extension.