-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Image prediction using trained model #2392
Conversation
✅ Deploy Preview for pytorch-tutorials-preview ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
Hello, the build failed on |
# the results. | ||
# | ||
|
||
def save_and_load_model(model, model_name): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a convoluted way to do a deepcopy?
I think in this case using deepcopy is fine if it works.
|
||
def visualize_model_upload_image(model,model_name,img_path): | ||
was_training = model.training | ||
model=save_and_load_model(model,model_name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this needed? If the original model is not modified by this function.
And the original model is not even used after this function...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I get your point. I'll make the changes as requested following PEP8 guidelines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you verified that this is working?
Also please address the comments and format the Python code according to PEP8.
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/tutorials/2392
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New FailureAs of commit 0650b47: NEW FAILURE - The following job has failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Updated the PR following the PEP8 guidelines and made the requested changes
Fixes #1110
Description
This commit enables us to perform image prediction using the saved model. We can now select any image and obtain a prediction for its corresponding label as described in the issue.
Checklist
cc @dreiss @jonas @pietern @svekars