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 49 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?

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?

@svekars
Copy link
Contributor

svekars commented Oct 8, 2024

This tutorial takes almost 200 minutes to build: https://docs-preview.pytorch.org/pytorch/tutorials/2971/beginner/Pretraining_Vgg_from_scratch.html which we can't support. I suggest you convert this to .rst instead so that it does not run in our CI.

Comment on lines 635 to 642
val_data.transform= A.Compose(
[
A.Normalize(),
A.SmallestMaxSize(max_size=val_data.S),
A.CenterCrop(height =224,width=224)
]

)
Copy link
Contributor

@jbschlosser jbschlosser Oct 8, 2024

Choose a reason for hiding this comment

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

Can you please run lintrunner -a (from here) on the code blocks throughout using the .lintrunner.toml config provided in the base PyTorch repo dir? The use of whitespace is inconsistent and makes the logic hard to read

@woongjoonchoi
Copy link
Contributor Author

@svekars Hi. svekars

I changed .html to .rst file and added it to begginer_source as .rst instead of .py. Sorry for the delay.

@woongjoonchoi
Copy link
Contributor Author

Hi @svekars .
I have converted it to an rst file, but is there anything else that needs to be refined?

.ci/docker/requirements.txt Outdated Show resolved Hide resolved

First, let's import the required dependencies:

.. GENERATED FROM PYTHON SOURCE LINES 67-92
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
.. GENERATED FROM PYTHON SOURCE LINES 67-92

Comment on lines 1 to 20

.. DO NOT EDIT.
.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY.
.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE:
.. "beginner/Pretraining_Vgg_from_scratch.py"
.. LINE NUMBERS ARE GIVEN BELOW.

.. only:: html

.. note::
:class: sphx-glr-download-link-note

Click :ref:`here <sphx_glr_download_beginner_Pretraining_Vgg_from_scratch.py>`
to download the full example code

.. rst-class:: sphx-glr-example-title

.. _sphx_glr_beginner_Pretraining_Vgg_from_scratch.py:


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
.. DO NOT EDIT.
.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY.
.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE:
.. "beginner/Pretraining_Vgg_from_scratch.py"
.. LINE NUMBERS ARE GIVEN BELOW.
.. only:: html
.. note::
:class: sphx-glr-download-link-note
Click :ref:`here <sphx_glr_download_beginner_Pretraining_Vgg_from_scratch.py>`
to download the full example code
.. rst-class:: sphx-glr-example-title
.. _sphx_glr_beginner_Pretraining_Vgg_from_scratch.py:

Setup
--------

.. note:: if you are running this in Google Colab, install ``albumentations`` by running:
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
.. note:: if you are running this in Google Colab, install ``albumentations`` by running:
.. note:: If you are running this in Google Colab, install ``albumentations`` by running:

Comment on lines 112 to 128






.. rst-class:: sphx-glr-script-out

.. code-block:: none

albumentations are already installed




.. GENERATED FROM PYTHON SOURCE LINES 93-100

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
.. rst-class:: sphx-glr-script-out
.. code-block:: none
albumentations are already installed
.. GENERATED FROM PYTHON SOURCE LINES 93-100

which means increasing the size of an image while maintaining its proportions,
preventing distortion and maintaining the consistency of the object.

.. GENERATED FROM PYTHON SOURCE LINES 100-140
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
.. GENERATED FROM PYTHON SOURCE LINES 100-140

Comment on lines 281 to 290








.. GENERATED FROM PYTHON SOURCE LINES 228-238

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
.. GENERATED FROM PYTHON SOURCE LINES 228-238

* ``Config_channels``: This refers to the number of output channels for each layer.
* ``Config_kernels``: This refers to the kernel size (or filter size) for each layer.

.. GENERATED FROM PYTHON SOURCE LINES 238-266
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
.. GENERATED FROM PYTHON SOURCE LINES 238-266

Comment on lines 332 to 341









.. GENERATED FROM PYTHON SOURCE LINES 267-269
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
.. GENERATED FROM PYTHON SOURCE LINES 267-269

Comment on lines 344 to 346


.. GENERATED FROM PYTHON SOURCE LINES 269-363
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
.. GENERATED FROM PYTHON SOURCE LINES 269-363

Comment on lines 441 to 451










.. GENERATED FROM PYTHON SOURCE LINES 364-377
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
.. GENERATED FROM PYTHON SOURCE LINES 364-377

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