paulhager / MMCL-Tabular-Imaging

82 stars 13 forks source link

Questions about the pytorch_lightning #7

Closed Ivygugu closed 11 months ago

Ivygugu commented 11 months ago

Hi,

I encountered the following problem in the process of reproducing:

Traceback (most recent call last):
  File "/home/gong/projects/MMCL-Tabular-Imaging/run.py", line 14, in <module>
    from trainers.pretrain import pretrain
  File "/home/gong/projects/MMCL-Tabular-Imaging/trainers/pretrain.py", line 10, in <module>
    from utils.ssl_online_custom import SSLOnlineEvaluator
  File "/home/gong/projects/MMCL-Tabular-Imaging/utils/ssl_online_custom.py", line 12, in <module>
    from pl_bolts.models.self_supervised.evaluator import SSLEvaluator
  File "/home/gong/anaconda3/envs/selfsuper/lib/python3.9/site-packages/pl_bolts/__init__.py", line 48, in <module>
    from pl_bolts import callbacks, datamodules, datasets, losses, metrics, models, optimizers, transforms, utils
  File "/home/gong/anaconda3/envs/selfsuper/lib/python3.9/site-packages/pl_bolts/callbacks/__init__.py", line 7, in <module>
    from pl_bolts.callbacks.ssl_online import SSLOnlineEvaluator  # noqa: F401
  File "/home/gong/anaconda3/envs/selfsuper/lib/python3.9/site-packages/pl_bolts/callbacks/ssl_online.py", line 5, in <module>
    from pytorch_lightning.metrics.functional import accuracy
ModuleNotFoundError: No module named 'pytorch_lightning.metrics'

I downloaded and installed the corresponding library according to environment.yaml, and installed "torchmetrics" at the same time, but the code still reports an error. I would like to ask how to solve this problem. Is it because some of my parameters are not set correctly or the environment does not match? Can you give me some suggestions?

Thank you!

paulhager commented 11 months ago

Hmmm, it seems like you don't have the correct pytorch_lightning version installed. Can you double check in your environment by providing the output of conda list? You should have pytorch-lightning version 1.6.4.

Here is my full list that you can check against: environment_mmcl.txt

paulhager commented 11 months ago

Closing due to inactivity. If you still have problems feel free to open another issue..