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

Documentation in tutorial is out of date #334

Open
urbanophile opened this issue Apr 17, 2023 · 1 comment
Open

Documentation in tutorial is out of date #334

urbanophile opened this issue Apr 17, 2023 · 1 comment

Comments

@urbanophile
Copy link

Describe the bug
The documentation doesn't reflect a recent refactoring of the code where utils.classifcation_dataloader was moved to data.classification_loader.py. This whole documentation section doesn't really reflect that the config management has been moved to hydra. Following along the tutorial results in various errors.

https://github.com/vturrisi/solo-learn/blob/main/docs/source/tutorials/overview.rst

To Reproduce
Copy-paste or link a bash script that reproduces the bug.

from solo.utils.classification_dataloader import prepare_data as prepare_data_classification

# and some utilities to perform data loading for the method itself, including augmentation pipelines
from solo.utils.pretrain_dataloader import (
    prepare_dataloader,
    prepare_datasets,
    prepare_n_crop_transform,
    prepare_transform,
)

produces the following stack trace

$ python3 my_custom_trainer.py 

home/matt/miniconda3/envs/solo-learn/lib/python3.9/site-packages/pl_bolts/models/self_supervised/amdim/amdim_module.py:35: UnderReviewWarning: The feature generate_power_seq is currently marked under review. The compatibility with other Lightning projects is not guaranteed and API may change at any time. The API and functionality may change without warning in future releases. More details: https://lightning-bolts.readthedocs.io/en/latest/stability.html
  "lr_options": generate_power_seq(LEARNING_RATE_CIFAR, 11),
/home/matt/miniconda3/envs/solo-learn/lib/python3.9/site-packages/pl_bolts/models/self_supervised/amdim/amdim_module.py:93: UnderReviewWarning: The feature FeatureMapContrastiveTask is currently marked under review. The compatibility with other Lightning projects is not guaranteed and API may change at any time. The API and functionality may change without warning in future releases. More details: https://lightning-bolts.readthedocs.io/en/latest/stability.html
  contrastive_task: Union[FeatureMapContrastiveTask] = FeatureMapContrastiveTask("01, 02, 11"),
/home/matt/miniconda3/envs/solo-learn/lib/python3.9/site-packages/pl_bolts/losses/self_supervised_learning.py:234: UnderReviewWarning: The feature AmdimNCELoss is currently marked under review. The compatibility with other Lightning projects is not guaranteed and API may change at any time. The API and functionality may change without warning in future releases. More details: https://lightning-bolts.readthedocs.io/en/latest/stability.html
  self.nce_loss = AmdimNCELoss(tclip)
/home/matt/miniconda3/envs/solo-learn/lib/python3.9/site-packages/pl_bolts/datamodules/experience_source.py:18: UnderReviewWarning: The feature warn_missing_pkg is currently marked under review. The compatibility with other Lightning projects is not guaranteed and API may change at any time. The API and functionality may change without warning in future releases. More details: https://lightning-bolts.readthedocs.io/en/latest/stability.html
  warn_missing_pkg("gym")
Traceback (most recent call last):
  File "/home/matt/phd/solo-learn/my_custom_trainer.py", line 13, in <module>
    from solo.utils.classification_dataloader import prepare_data as prepare_data_classification
ModuleNotFoundError: No module named 'solo.utils.classification_dataloader'

Versions
Please report the versions of the packages that you have installed (especially PyTorch and PyTorchLightning) and the version of solo-learn that you are running.
Ubuntu 20.04.6 LTS, Driver Version: 530.30.02, CUDA Version: 12.1, Python 3.9.0

Package                Version
---------------------- ------------
aiohttp                3.8.4
aiosignal              1.3.1
antlr4-python3-runtime 4.9.3
appdirs                1.4.4
asttokens              2.2.1
astunparse             1.6.3
async-timeout          4.0.2
attrs                  23.1.0
backcall               0.2.0
certifi                2022.12.7
charset-normalizer     3.1.0
click                  8.1.3
contourpy              1.0.7
cycler                 0.11.0
decorator              5.1.1
docker-pycreds         0.4.0
einops                 0.6.0
executing              1.2.0
filelock               3.11.0
fonttools              4.39.3
frozenlist             1.3.3
fsspec                 2023.4.0
gast                   0.4.0
gitdb                  4.0.10
GitPython              3.1.31
h5py                   3.8.0
huggingface-hub        0.13.4
hydra-core             1.3.2
idna                   3.4
importlib-resources    5.12.0
ipython                8.12.0
jedi                   0.18.2
joblib                 1.2.0
kiwisolver             1.4.4
lightning-bolts        0.6.0.post1
lightning-utilities    0.8.0
llvmlite               0.39.1
matplotlib             3.7.1
matplotlib-inline      0.1.6
multidict              6.0.4
numba                  0.56.4
numpy                  1.23.5
nvidia-dali-cuda110    1.24.0
omegaconf              2.3.0
packaging              23.1
pandas                 2.0.0
parso                  0.8.3
pathtools              0.1.2
pexpect                4.8.0
pickleshare            0.7.5
Pillow                 9.5.0
pip                    23.1
prompt-toolkit         3.0.38
protobuf               3.20.3
psutil                 5.9.4
ptyprocess             0.7.0
pure-eval              0.2.2
Pygments               2.15.0
pynndescent            0.5.8
pyparsing              3.0.9
python-dateutil        2.8.2
pytorch-lightning      1.8.6
pytz                   2023.3
PyYAML                 6.0
requests               2.28.2
scikit-learn           1.2.2
scipy                  1.10.1
seaborn                0.12.2
sentry-sdk             1.19.1
setproctitle           1.3.2
setuptools             67.6.1
six                    1.16.0
smmap                  5.0.0
solo-learn             1.0.6
stack-data             0.6.2
tensorboardX           2.6
threadpoolctl          3.1.0
timm                   0.6.13
torch                  1.13.1+cu117
torchaudio             0.13.1+cu117
torchmetrics           0.11.4
torchvision            0.14.1+cu117
tqdm                   4.65.0
traitlets              5.9.0
typing_extensions      4.5.0
tzdata                 2023.3
umap-learn             0.5.3
urllib3                1.26.15
wandb                  0.14.2
wcwidth                0.2.6
wheel                  0.40.0
yarl                   1.8.2
zipp                   3.15.0

Additional comments
These kind of documentation bugs can be quite frustrating for new users. The documentation for this project is pretty good, but the change to using the hydra config is not very clear. Can I suggest using something like Sphinx's doctest to make sure the docs stay up to date?
https://sphinx-tutorial.readthedocs.io/step-3/

Also I didn't know how to adjust the example at the bottom of the overview.rst using python3 main_pretrain.py to use the hydra cli parameter update notation.

@urbanophile
Copy link
Author

urbanophile commented Apr 17, 2023

Oops, I didn't see issue #326. Sorry about the duplicate.

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

No branches or pull requests

1 participant