Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b0cb64a

Browse files
cxxgtxychsasank
authored andcommitted
Fix prediction error in transfer learning. (#119)
* Fix prediction error. * Fix spelling error in neural_style transfer.
1 parent 0bb55c5 commit b0cb64a

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

advanced_source/neural_style_tutorial.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@
179179
# .. Note::
180180
# Here are links to download the images required to run the tutorial:
181181
# `picasso.jpg <http://pytorch.org/tutorials/_static/img/neural-style/picasso.jpg>`__ and
182-
# `dancing.jpg <http://pytorch.org/tutorials/_static/img/neural-style/picasso.jpg>`__.
182+
# `dancing.jpg <http://pytorch.org/tutorials/_static/img/neural-style/dancing.jpg>`__.
183183
# Download these two images and add them to a directory
184184
# with name ``images``
185185

@@ -269,8 +269,8 @@ def imshow(tensor, title=None):
269269
#
270270
# Finally, we define a fake ``backward`` method, that just call the
271271
# backward method of ``nn.MSELoss`` in order to reconstruct the gradient.
272-
# This method returns the computed loss: this will be usefull when running
273-
# the gradien descent in order to display the evolution of style and
272+
# This method returns the computed loss: this will be useful when running
273+
# the gradient descent in order to display the evolution of style and
274274
# content losses.
275275
#
276276

beginner_source/transfer_learning_tutorial.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ def visualize_model(model, num_images=6):
253253
images_so_far += 1
254254
ax = plt.subplot(num_images//2, 2, images_so_far)
255255
ax.axis('off')
256-
ax.set_title('predicted: {}'.format(dset_classes[labels.data[j]]))
256+
ax.set_title('predicted: {}'.format(dset_classes[preds[j][0]]))
257257
imshow(inputs.cpu().data[j])
258258

259259
if images_so_far == num_images:

0 commit comments

Comments
 (0)