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

Error with pytorch-lightning 2.0.0 #470

Closed
jlkjlkj opened this issue Mar 29, 2023 · 0 comments · Fixed by #476
Closed

Error with pytorch-lightning 2.0.0 #470

jlkjlkj opened this issue Mar 29, 2023 · 0 comments · Fixed by #476
Labels
bug Something isn't working

Comments

@jlkjlkj
Copy link

jlkjlkj commented Mar 29, 2023

Describe the bug
After initial standalone install with WLS2 Ubuntu 22.04.2 LTS running on Windows 11 and pytorch-lightning 2.0.0, I got below mentioned error. After downgrading to 1.7.2 the error disappeared.

To Reproduce
Steps to reproduce the behavior:

  1. Start WSL2
  2. conda activate graphnet
  3. cd graphnet
  4. cd examples
  5. cd 04_training
  6. python 01_train_model.py

Expected behavior

TypeError: `devices` selected with `CPUAccelerator` should be an int > 0.

Full traceback
Please include the full error message to allow for debugging

Traceback (most recent call last):
  File "01_train_model.py", line 171, in <module>
    main(
  File "01_train_model.py", line 97, in main
    model.fit(
  File "/home/jonathan/graphnet/src/graphnet/models/model.py", line 93, in fit
    self._construct_trainers(
  File "/home/jonathan/graphnet/src/graphnet/models/model.py", line 50, in _construct_trainers
    self._trainer = Trainer(
  File "/home/jonathan/anaconda3/envs/graphnet/lib/python3.8/site-packages/pytorch_lightning/utilities/argparse.py", line 69, in insert_env_defaults
    return fn(self, **kwargs)
  File "/home/jonathan/anaconda3/envs/graphnet/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 393, in __init__
    self._accelerator_connector = _AcceleratorConnector(
  File "/home/jonathan/anaconda3/envs/graphnet/lib/python3.8/site-packages/pytorch_lightning/trainer/connectors/accelerator_connector.py", line 157, in __init__
    self._set_parallel_devices_and_init_accelerator()
  File "/home/jonathan/anaconda3/envs/graphnet/lib/python3.8/site-packages/pytorch_lightning/trainer/connectors/accelerator_connector.py", line 391, in _set_parallel_devices_and_init_accelerator
    self._devices_flag = accelerator_cls.parse_devices(self._devices_flag)
  File "/home/jonathan/anaconda3/envs/graphnet/lib/python3.8/site-packages/pytorch_lightning/accelerators/cpu.py", line 47, in parse_devices
    devices = _parse_cpu_cores(devices)
  File "/home/jonathan/anaconda3/envs/graphnet/lib/python3.8/site-packages/lightning_fabric/accelerators/cpu.py", line 85, in _parse_cpu_cores
    raise TypeError("`devices` selected with `CPUAccelerator` should be an int > 0.")
TypeError: `devices` selected with `CPUAccelerator` should be an int > 0.

Additional context

$ pip list
Package                       Version                  Editable project location
----------------------------- ------------------------ ---------------------------
aiohttp                       3.8.4
aiosignal                     1.3.1
alabaster                     0.7.13
appdirs                       1.4.4
astroid                       2.15.1
async-timeout                 4.0.2
attrs                         22.2.0
awkward                       1.10.3
Babel                         2.12.1
beautifulsoup4                4.12.0
black                         23.1.0
certifi                       2022.12.7
cfgv                          3.3.1
charset-normalizer            2.1.1
click                         8.1.3
colorlog                      6.7.0
ConfigUpdater                 3.1.1
contourpy                     1.0.7
coverage                      7.2.2
css-html-js-minify            2.5.5
cycler                        0.11.0
dill                          0.3.6
distlib                       0.3.6
docformatter                  1.5.1
docker-pycreds                0.4.0
docutils                      0.19
exceptiongroup                1.1.1
filelock                      3.10.7
fonttools                     4.39.3
frozenlist                    1.3.3
fsspec                        2023.3.0
gitdb                         4.0.10
GitPython                     3.1.31
graphnet                      0+untagged.2320.g9530955 /home/jonathan/graphnet/src
greenlet                      2.0.2
identify                      2.5.22
idna                          3.4
imagesize                     1.4.1
importlib-metadata            6.1.0
importlib-resources           5.12.0
iniconfig                     2.0.0
isort                         5.12.0
Jinja2                        3.1.2
joblib                        1.2.0
kiwisolver                    1.4.4
lazy-object-proxy             1.9.0
lightning-utilities           0.8.0
lxml                          4.9.2
markdown-it-py                2.2.0
MarkupSafe                    2.1.0
matplotlib                    3.7.1
mccabe                        0.7.0
mdit-py-plugins               0.3.5
mdurl                         0.1.2
multidict                     6.0.4
mypy                          1.1.1
mypy-extensions               1.0.0
myst-parser                   1.0.0
nodeenv                       1.7.0
numpy                         1.24.2
packaging                     23.0
pandas                        1.5.3
pathspec                      0.11.1
pathtools                     0.1.2
Pillow                        9.4.0
pip                           23.0.1
platformdirs                  3.2.0
pluggy                        1.0.0
pre-commit                    3.2.1
protobuf                      4.22.1
psutil                        5.9.4
pyarrow                       11.0.0
pydantic                      1.10.7
pydocstyle                    6.3.0
Pygments                      2.14.0
pylint                        2.17.1
pyparsing                     3.0.9
pytest                        7.2.2
pytest-order                  1.1.0
python-dateutil               2.8.2
python-slugify                8.0.1
pytorch-lightning             2.0.0
pytz                          2023.2
PyYAML                        6.0
requests                      2.28.2
ruamel.yaml                   0.17.21
ruamel.yaml.clib              0.2.7
scikit-learn                  1.2.2
scipy                         1.10.1
sentry-sdk                    1.18.0
setproctitle                  1.3.2
setuptools                    67.6.0
six                           1.16.0
smmap                         5.0.0
snowballstemmer               2.2.0
soupsieve                     2.4
Sphinx                        6.1.3
sphinx_autodoc_typehints      1.22
sphinx-material               0.0.35
sphinxcontrib-applehelp       1.0.4
sphinxcontrib-devhelp         1.0.2
sphinxcontrib-htmlhelp        2.0.1
sphinxcontrib-jsmath          1.0.1
sphinxcontrib-qthelp          1.0.3
sphinxcontrib-serializinghtml 1.1.5
SQLAlchemy                    2.0.7
text-unidecode                1.3
threadpoolctl                 3.1.0
timer                         0.2.2
tomli                         2.0.1
tomlkit                       0.11.7
torch                         1.11.0+cpu
torch-cluster                 1.6.0
torch-geometric               2.0.4
torch-scatter                 2.0.9
torch-sparse                  0.6.13
torchmetrics                  0.11.4
tqdm                          4.65.0
typing_extensions             4.5.0
Unidecode                     1.3.6
untokenize                    0.1.1
urllib3                       1.26.15
versioneer                    0.28
virtualenv                    20.21.0
wandb                         0.14.0
wheel                         0.40.0
wrapt                         1.15.0
yarl                          1.8.2
zipp                          3.15.0
@jlkjlkj jlkjlkj added the bug Something isn't working label Mar 29, 2023
@jlkjlkj jlkjlkj changed the title TypeError: devices selected with CPUAccelerator should be an int > 0 Error with pytorch-lightning 2.0.0 Mar 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant