When creating a new conda environment and installing the skm-tea package using pip install skm-tea, importing the package returns an error caused by the pytorch-lightning package:
>>> import skm_tea as skm
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/mnt/qb/envs/.conda/envs/skm2/lib/python3.9/site-packages/skm_tea/__init__.py", line 1, in <module>
from skm_tea.engine.model_zoo import get_model_from_zoo # noqa: F401
File "/mnt/qb/envs/.conda/envs/skm2/lib/python3.9/site-packages/skm_tea/engine/__init__.py", line 1, in <module>
from skm_tea.engine import defaults, model_zoo, modules, trainer # noqa: F401
File "/mnt/qb/envs/.conda/envs/skm2/lib/python3.9/site-packages/skm_tea/engine/model_zoo.py", line 10, in <module>
from skm_tea.engine.modules import SkmTeaModule, SkmTeaSemSegModule
File "/mnt/qb/envs/.conda/envs/skm2/lib/python3.9/site-packages/skm_tea/engine/modules/__init__.py", line 3, in <module>
from skm_tea.engine.modules import base, module, recon
File "/mnt/qb/envs/.conda/envs/skm2/lib/python3.9/site-packages/skm_tea/engine/modules/base.py", line 18, in <module>
from skm_tea.engine.trainer import convert_cfg_time_to_iter
File "/mnt/qb/envs/.conda/envs/skm2/lib/python3.9/site-packages/skm_tea/engine/trainer.py", line 13, in <module>
from pytorch_lightning.utilities.distributed import rank_zero_only
ImportError: cannot import name 'rank_zero_only' from 'pytorch_lightning.utilities.distributed' (/mnt/qb/envs/.conda/envs/skm2/lib/python3.9/site-packages/pytorch_lightning/utilities/distributed.py)
These errors can be avoided by installing the pytorch-lightning version 1.7.7. The requirements.txt file might need to be adjusted, such that pytorch-lightning < 1.8 is installed.
When creating a new conda environment and installing the skm-tea package using
pip install skm-tea
, importing the package returns an error caused by the pytorch-lightning package:Correcting this issue yields other issues related to the updated pytorch-lightning package (like the removed LoggerCollection with the recent update https://pytorch-lightning.readthedocs.io/en/stable/generated/CHANGELOG.html).
These errors can be avoided by installing the pytorch-lightning version 1.7.7. The requirements.txt file might need to be adjusted, such that pytorch-lightning < 1.8 is installed.