Skip to content

SSL Tutorial updated as being notebooks #1177

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

Merged
merged 7 commits into from
Jan 20, 2023

Conversation

finalelement
Copy link
Contributor

Signed-off-by: Vishwesh Nath [email protected]

Converts the python scripts to being jupyter notebooks that are reflected in MONAI Toolkit.

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Signed-off-by: Vishwesh Nath <[email protected]>
@mingxin-zheng
Copy link
Contributor

Thank you @finalelement for the PR!

  • Regarding the license header, we slightly modify the template to fit Jupyter notebooks. Please copy it from here for the exact format.
  • The Contributing guidelines require "## Setup environment" and "Setup imports" cells to standardize the notebook, and ease the packing of the toolkit. Can we ensure the notebooks following the guidelines here?
  • Because there is no automatic download of the dataset, the notebooks needs to be excluded from the CI/CD papermill test. Can you refer to here for how to fix it?

@finalelement
Copy link
Contributor Author

@mingxin-zheng I've tried addressing all the comments. Please see if there is anything more that I can do from my side.

@mingxin-zheng
Copy link
Contributor

The comments above should fix these relevant check failures in build/guidelines:

  • Error: Missing the "Setup imports" after the first code cell of file: /home/runner/work/tutorials/tutorials/self_supervised_pretraining/ssl_finetune.ipynb.
  • Error: print_config() cannot be found after the "Setup imports" markdown cell in file: /home/runner/work/tutorials/tutorials/self_supervised_pretraining/ssl_finetune.ipynb.
  • Error: Missing the "Setup imports" after the first code cell of file: /home/runner/work/tutorials/tutorials/self_supervised_pretraining/ssl_train.ipynb.
  • Error: print_config() cannot be found after the "Setup imports" markdown cell in file: /home/runner/work/tutorials/tutorials/self_supervised_pretraining/ssl_train.ipynb.

But there are some errors in build/pep8 that needs attention:

Checking PEP8 compliance...
stdin:290:13: B007 Loop control variable 'step' not used within the loop body. If this is intended, start the name with an underscore.
        for step, batch in enumerate(epoch_iterator_val):
            ^
Error: Try running with autofixes: --autofix.

Check failed!
Running ./self_supervised_pretraining/ssl_train.ipynb
Checking PEP8 compliance...
stdin:88:10: B007 Loop control variable 'each_d' not used within the loop body. If this is intended, start the name with an underscore.
for idx, each_d in enumerate(train_data):
         ^
stdin:91:10: B007 Loop control variable 'each_d' not used within the loop body. If this is intended, start the name with an underscore.
for idx, each_d in enumerate(val_data):
         ^
Error: Try running with autofixes: --autofix.

@mingxin-zheng
Copy link
Contributor

Because the SSL notebooks are created in this PR, the notebook list in README.md should also be updated.

@finalelement
Copy link
Contributor Author

Addressed all comments again, lets see if the tests work out this time.

@finalelement
Copy link
Contributor Author

The 2 failing tests are from other prior notebooks. Let me know if more changes are needed to the SSL notebooks.

@mingxin-zheng mingxin-zheng enabled auto-merge (squash) January 20, 2023 06:06
@mingxin-zheng
Copy link
Contributor

Thank you @finalelement . It looks good to me!

@mingxin-zheng mingxin-zheng merged commit 9a9106d into Project-MONAI:main Jan 20, 2023
boneseva pushed a commit to boneseva/MONAI-tutorials that referenced this pull request Apr 21, 2024
Signed-off-by: Vishwesh Nath <[email protected]>

Converts the python scripts to being jupyter notebooks that are
reflected in MONAI Toolkit.

Signed-off-by: Vishwesh Nath <[email protected]>
Co-authored-by: Vishwesh Nath <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants