Skip to content

Fix warning in fast_neural_style example#2984

Merged
vfdev-5 merged 4 commits intomasterfrom
sweep/fix-warning-fast-neural-style-example
Jul 7, 2023
Merged

Fix warning in fast_neural_style example#2984
vfdev-5 merged 4 commits intomasterfrom
sweep/fix-warning-fast-neural-style-example

Conversation

@sweep-ai-deprecated
Copy link
Copy Markdown
Contributor

Description:
This PR fixes a warning in the fast_neural_style example by updating the usage of the 'pretrained' parameter in the torchvision.models.vgg16 function. The 'pretrained' parameter is deprecated and has been replaced with the 'weights' parameter. The equivalent value for 'pretrained=True' is now set to 'weights=torchvision.models.vgg16.VGG16_Weights.IMAGENET1K_V1'.

Changes Made:

  • Updated the usage of the 'pretrained' parameter in the torchvision.models.vgg16 function call in the examples/fast_neural_style/vgg.py file.

Testing:

  • Tested the modified code locally to ensure that the warning is no longer present.

Related Issue:

Fixes #2983.

To checkout this PR branch, run the following command in your terminal:

git checkout sweep/fix-warning-fast-neural-style-example

@github-actions github-actions bot added the examples Examples label Jul 6, 2023
Copy link
Copy Markdown
Contributor Author

@sweep-ai-deprecated sweep-ai-deprecated bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes made in the pull request are appropriate and improve the code by explicitly specifying the weights for the VGG16 model. No further changes are required.

@vfdev-5
Copy link
Copy Markdown
Collaborator

vfdev-5 commented Jul 6, 2023

@sweep-ai code formatting is failed with error:

examples/fast_neural_style/vgg.py:7:1: E302 expected 2 blank lines, found 1
examples/fast_neural_style/vgg.py:39:1: W391 blank line at end of file

@vfdev-5 vfdev-5 enabled auto-merge (squash) July 7, 2023 09:21
@vfdev-5 vfdev-5 merged commit 9519e9d into master Jul 7, 2023
@vfdev-5 vfdev-5 deleted the sweep/fix-warning-fast-neural-style-example branch July 10, 2023 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

examples Examples

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix warning in fast_neural_style example

1 participant