bishwarup307 / retinanet-lightning

Retinanet implementation in pytorch lightning
5 stars 0 forks source link

retinanet-lightning/retinanet/models.py", line 319, in validation_epoch_end avg_reg_loss = avg_cls_loss[ | IndexError: too many indices for tensor of dimension 0 #5

Open Egorundel opened 9 months ago

Egorundel commented 9 months ago

Hello, can you tell me what the problem might be?

Here is a screenshot with the error:

Traceback (most recent call last):███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 324/324 [00:44<00:00,  7.29it/s]
  File "train.py", line 77, in <module>
    main()
  File "train.py", line 68, in main
    trainer.fit(model, dm)
  File "/home/egorundel/venvs/retinanet-lightning/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 603, in fit
    call._call_and_handle_interrupt(
  File "/home/egorundel/venvs/retinanet-lightning/lib/python3.8/site-packages/pytorch_lightning/trainer/call.py", line 38, in _call_and_handle_interrupt
    return trainer_fn(*args, **kwargs)
  File "/home/egorundel/venvs/retinanet-lightning/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 645, in _fit_impl
    self._run(model, ckpt_path=self.ckpt_path)
  File "/home/egorundel/venvs/retinanet-lightning/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 1098, in _run
    results = self._run_stage()
  File "/home/egorundel/venvs/retinanet-lightning/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 1177, in _run_stage
    self._run_train()
  File "/home/egorundel/venvs/retinanet-lightning/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 1200, in _run_train
    self.fit_loop.run()
  File "/home/egorundel/venvs/retinanet-lightning/lib/python3.8/site-packages/pytorch_lightning/loops/loop.py", line 199, in run
    self.advance(*args, **kwargs)
  File "/home/egorundel/venvs/retinanet-lightning/lib/python3.8/site-packages/pytorch_lightning/loops/fit_loop.py", line 267, in advance
    self._outputs = self.epoch_loop.run(self._data_fetcher)
  File "/home/egorundel/venvs/retinanet-lightning/lib/python3.8/site-packages/pytorch_lightning/loops/loop.py", line 200, in run
    self.on_advance_end()
  File "/home/egorundel/venvs/retinanet-lightning/lib/python3.8/site-packages/pytorch_lightning/loops/epoch/training_epoch_loop.py", line 251, in on_advance_end
    self._run_validation()
  File "/home/egorundel/venvs/retinanet-lightning/lib/python3.8/site-packages/pytorch_lightning/loops/epoch/training_epoch_loop.py", line 310, in _run_validation
    self.val_loop.run()
  File "/home/egorundel/venvs/retinanet-lightning/lib/python3.8/site-packages/pytorch_lightning/loops/loop.py", line 206, in run
    output = self.on_run_end()
  File "/home/egorundel/venvs/retinanet-lightning/lib/python3.8/site-packages/pytorch_lightning/loops/dataloader/evaluation_loop.py", line 180, in on_run_end
    self._evaluation_epoch_end(self._outputs)
  File "/home/egorundel/venvs/retinanet-lightning/lib/python3.8/site-packages/pytorch_lightning/loops/dataloader/evaluation_loop.py", line 288, in _evaluation_epoch_end
    self.trainer._call_lightning_module_hook(hook_name, output_or_outputs)
  File "/home/egorundel/venvs/retinanet-lightning/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 1342, in _call_lightning_module_hook
    output = fn(*args, **kwargs)
  File "/home/egorundel/projects/retinanet-lightning/retinanet/models.py", line 319, in validation_epoch_end
    avg_reg_loss = avg_cls_loss[
IndexError: too many indices for tensor of dimension 0

Screenshot from 2024-01-17 13-26-51

My system:

RTX 3060 CUDA 11.1

My installed pip packages:

absl-py                              2.1.0
action-tutorials-py                  0.9.4
aiohttp                              3.9.1
aiosignal                            1.3.1
albumentations                       1.3.1
async-timeout                        4.0.3
attrs                                23.2.0
cachetools                           5.3.2
certifi                              2023.11.17
charset-normalizer                   3.3.2
colorama                             0.4.4
contourpy                            1.1.1
cycler                               0.12.1
demo-nodes-py                        0.9.4
domain-coordinator                   0.9.2
fire                                 0.5.0
fonttools                            4.47.2
frozenlist                           1.4.1
fsspec                               2023.12.2
google-auth                          2.26.2
google-auth-oauthlib                 1.0.0
grpcio                               1.60.0
idna                                 3.6
imageio                              2.33.1
importlib-metadata                   7.0.1
importlib-resources                  6.1.1
joblib                               1.3.2
kiwisolver                           1.4.5
launch                               0.10.10
launch-ros                           0.11.7
launch-testing                       0.10.10
launch-testing-ros                   0.11.7
launch-xml                           0.10.10
launch-yaml                          0.10.10
lazy_loader                          0.3
lightning-utilities                  0.3.0
Markdown                             3.5.2
MarkupSafe                           2.1.3
matplotlib                           3.7.4
multidict                            6.0.4
networkx                             3.1
numpy                                1.24.4
oauthlib                             3.2.2
omegaconf                            2.0.5
opencv-python-headless               4.9.0.80
osrf-pycommon                        0.1.11
packaging                            23.2
pillow                               10.2.0
pip                                  23.3.2
pkg_resources                        0.0.0
protobuf                             4.25.2
pyasn1                               0.5.1
pyasn1-modules                       0.3.0
pycocotools                          2.0.7
pyparsing                            3.1.1
python-dateutil                      2.8.2
pytorch-lightning                    1.8.6
PyWavelets                           1.4.1
PyYAML                               6.0.1
quality-of-service-demo-py           0.9.4
qudida                               0.0.4
requests                             2.31.0
requests-oauthlib                    1.3.1
rsa                                  4.9
scikit-image                         0.21.0
scikit-learn                         1.3.2
scipy                                1.10.1
setuptools                           69.0.3
six                                  1.16.0
teleop-twist-keyboard                2.3.2
tensorboard                          2.14.0
tensorboard-data-server              0.7.2
tensorboardX                         2.6.2.2
termcolor                            2.4.0
threadpoolctl                        3.2.0
tifffile                             2023.7.10
topic-monitor                        0.9.4
torch                                1.9.1+cu111
torchaudio                           0.9.1
torchmetrics                         0.11.4
torchvision                          0.10.1+cu111
tqdm                                 4.66.1
typing_extensions                    4.9.0
urllib3                              2.1.0
Werkzeug                             3.0.1
wheel                                0.42.0
yarl                                 1.9.4
zipp                                 3.17.0
Egorundel commented 9 months ago

@bishwarup307 Hello, can your help me, please?