Skip to content
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

Tutorials : Pretraining VGG from Scrtach #2971

Open
wants to merge 37 commits into
base: main
Choose a base branch
from

Conversation

woongjoonchoi
Copy link
Contributor

@woongjoonchoi woongjoonchoi commented Jul 13, 2024

Fixes #ISSUE_NUMBER

Description

I make a new tutorial training VGG from scratch . There are no tutorials traning Vgg from scratch.

Checklist

  • The issue that is being fixed is referred in the description (see above "Fixes #ISSUE_NUMBER")
  • Only one issue is addressed in this pull request
  • Labels from the issue that this PR is fixing are added to this pull request
  • No unnecessary issues are included into this pull request.

cc @subramen @albanD

saving and loading a general checkpoint.py  \n intial -> initial
toctree : Image and Video

Pretraining Vgg from scratch
Copy link

pytorch-bot bot commented Jul 13, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/tutorials/2971

Note: Links to docs will display an error until the docs builds have been completed.

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@svekars svekars added core Tutorials of any level of difficulty related to the core pytorch functionality intro labels Jul 15, 2024
@@ -0,0 +1,643 @@
"""
In this tutorial, we will embark on an exciting journey to build and
Copy link
Contributor

Choose a reason for hiding this comment

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

Please follow this template . Your tutorials should have: Title, a short abstract, Author, Overview, Steps, and Conclusion. Please maintain a third-person narrative throughout the document. Avoid using first-person pronouns like "I" and instead use "we". Use active voice where possible.

Follow Pytorch Tutorial convetion

Modify I -> We
Add More things to try  , Conclusion , Further Reading
@woongjoonchoi
Copy link
Contributor Author

woongjoonchoi commented Jul 22, 2024

Hi @svekars, could you please help to take a look of this PR?

@woongjoonchoi
Copy link
Contributor Author

woongjoonchoi commented Jul 24, 2024

Hi @svekars, could you please help to take a look of this PR again?
I fix pyspellchecker issue and package install issue.

@woongjoonchoi
Copy link
Contributor Author

Hi @svekars , could you please help to take a look of this PR again?

Copy link
Contributor

@jbschlosser jbschlosser left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

@svekars are you okay with handling review for the polish needed for this tutorial? (e.g. grammar / punctuation / spacing). I added several comments regarding this but it's incomplete and I shifted to focusing on the ML component of the tutorial.

Made a pass but haven't spent a ton of time verifying the code logic yet. I can take another look once some of these issues are addressed.



######################################################################
# Worth point of this tutorial
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# Worth point of this tutorial
# Purpose of this tutorial

Comment on lines 9 to 10
train a VGG network from scratch using Python and popular deep learning
libraries such as PyTorch. We will dive into the details of the VGG
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
train a VGG network from scratch using Python and popular deep learning
libraries such as PyTorch. We will dive into the details of the VGG
train a VGG network from scratch using PyTorch. We will dive into the details of the VGG

Copy link
Contributor

Choose a reason for hiding this comment

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

A better intro would be:

VGG (Visual Geometry Group) is a convolutional neural network architecture that is particularly
efficient in image classification tasks. In this tutorial, we will guide you through building
and training a VGG network from scratch using Python and PyTorch. We will dive into the details of the VGG
architecture, understanding its components and the rationale behind its
design.



######################################################################
# | If your GPU memory is 24GB ,The maximum batch size is 128. But, if you
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# | If your GPU memory is 24GB ,The maximum batch size is 128. But, if you
# | If your GPU memory is 24GB, the maximum batch size is 128. But if you


######################################################################
# | If your GPU memory is 24GB ,The maximum batch size is 128. But, if you
# use Colab , We recommend using 32 .
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# use Colab , We recommend using 32 .
# use Colab, we recommend using 32GB.



######################################################################
# We use ``CIFAR100`` Dataset in this tutorial. In VGG paper , the authors
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# We use ``CIFAR100`` Dataset in this tutorial. In VGG paper , the authors
# We use the ``CIFAR100`` dataset in this tutorial. In VGG paper, the authors

# When training VGG , the authors first train model A , then initialized
# the weights of other models with the weights of model A. Waiting for
# Model A to be trained takes a long time . The authors mention how to
# train with ``xavier`` initialization rather than initializing with the
Copy link
Contributor

Choose a reason for hiding this comment

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

capitalization nit: xavier -> Xavier throughout

Comment on lines 364 to 365
# When training VGG , the authors first train model A , then initialized
# the weights of other models with the weights of model A. Waiting for
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# When training VGG , the authors first train model A , then initialized
# the weights of other models with the weights of model A. Waiting for
# When training VGG, the authors first train model A, then continue training from
# the resultant weights for other variants. Waiting for

# -------------------
#

class Cusotm_ImageNet(ImageNet) :
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
class Cusotm_ImageNet(ImageNet) :
class Custom_ImageNet(ImageNet) :

######################################################################
# Conclusion
# ----------
# We have seen how ``pretraining`` VGG from scratch . This Tutorial will be helpful to reproduce another Foundation Model .
Copy link
Contributor

Choose a reason for hiding this comment

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

this needs to be expanded a bit, and I'm not sure what is meant by the Foundation Model comment

Comment on lines 655 to 657
# - Trying On ImageNet
# - Try All version of Model
# - Try All evaluation method in VGG paper
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# - Trying On ImageNet
# - Try All version of Model
# - Try All evaluation method in VGG paper
# - Apply model to ImageNet
# - Try all model variants
# - Try additional evaluation methods

@svekars
Copy link
Contributor

svekars commented Aug 29, 2024

@svekars are you okay with handling review for the polish needed for this tutorial? (e.g. grammar / punctuation / spacing). I added several comments regarding this but it's incomplete and I shifted to focusing on the ML component of the tutorial.

@jbschlosser yes, I will do the editorial pass as long as we align on the overall technical content.

Lint and Technical Details and flexible code style
@woongjoonchoi
Copy link
Contributor Author

@svekars Sorry for being late. I've been busy with lab work. I've made some revisions based on the feedback I received. Could you check again?

@svekars
Copy link
Contributor

svekars commented Sep 16, 2024

There is a build error related to the code.

svekars and others added 2 commits September 16, 2024 11:22
Editorial and formatting fixes
* Complete the `Learn the Basics tutorials <https://pytorch.org/tutorials/beginner/basics/intro.html>`__
* Familiarity with basic machine learning concepts and terms

If you are running this in Google Colab, install albumentations
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
If you are running this in Google Colab, install albumentations
If you are running this in Google Colab, install albumentations by running the following command:
.. code-block:: py
!pip install albumentations

beginner_source/Pretraining_Vgg_from_scratch.py Outdated Show resolved Hide resolved
train loader fail
train loader fail
feedback accepted

Re PullRequest because of network issue
index.rst Outdated Show resolved Hide resolved
index.rst Outdated Show resolved Hide resolved
beginner_source/Pretraining_Vgg_from_scratch.py Outdated Show resolved Hide resolved
index.rst Outdated Show resolved Hide resolved
@woongjoonchoi
Copy link
Contributor Author

@svekars Are there any other things I need to fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla signed core Tutorials of any level of difficulty related to the core pytorch functionality intro
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants