# Neural Style Transfer Steps

**URL:** <https://discuss.pytorch.org/t/neural-style-transfer-steps/87853>\
**Category:** vision\
**Created:** [July 3, 2020, 1:28pm UTC](https://discuss.pytorch.org/t/neural-style-transfer-steps/87853 "2020-07-03T13:28:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jesselin](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/jesselin/32/26290_2.png) [@jesselin](https://discuss.pytorch.org/u/jesselin)\
**Post date:** [July 3, 2020, 1:28pm UTC](https://discuss.pytorch.org/t/neural-style-transfer-steps/87853/1 "2020-07-03T13:28:56Z")

</div>

Hello! This is my first post here, so forgive me if this has already been discussed or is in a tutorial, but I am building the tutorial neural style transfer network ([here](https://pytorch.org/tutorials/advanced/neural_style_tutorial.html?highlight=style%20transfer)), and I am trying to simply see each 50 steps of the run, which is 300 steps by default in the tutorial. I am just looking to display the resulting image from each 50 steps once the run has been completed.

Again, forgive me if this is well documented, I am very new to coding, pytorch, and neural networks, and any advice or help would be much appreciated!

---

<div class="post-metadata">

**Author:** ![tom](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/tom/32/3162_2.png) [@tom](https://discuss.pytorch.org/u/tom)\
**Post date:** [July 3, 2020, 4:10pm UTC](https://discuss.pytorch.org/t/neural-style-transfer-steps/87853/2 "2020-07-03T16:10:42Z")

</div>

You can take the image display code (`plt.` calls before the output image) and move it to after `optimizer.step()` (also clamp, but don’t overwrite the `input_img` (so use detach().clamp()).

Best regards

Thomas
