michal2409 / xView2

Image segmentation models for building localization and damage assessment based on satellite imagery from the xBD dataset which was used for the xView2 challenge.
MIT License
24 stars 4 forks source link

idx issue #11

Open mmuneeburahman opened 1 year ago

mmuneeburahman commented 1 year ago

After starting the docker container, when I run a command to train a model. It gives this error

Traceback (most recent call last):
  File "main.py", line 10, in <module>
    from data_loading.data_module import DataModule
  File "/workspace/xview2/data_loading/data_module.py", line 5, in <module>
    from data_loading.pytorch_loader import fetch_pytorch_loader
  File "/workspace/xview2/data_loading/pytorch_loader.py", line 5, in <module>
    import albumentations as A
  File "/opt/conda/lib/python3.8/site-packages/albumentations/__init__.py", line 5, in <module>
    from .core.composition import *
  File "/opt/conda/lib/python3.8/site-packages/albumentations/core/composition.py", line 8, in <module>
    from albumentations.augmentations.keypoints_utils import KeypointsProcessor
  File "/opt/conda/lib/python3.8/site-packages/albumentations/augmentations/__init__.py", line 4, in <module>
    from .functional import *
  File "/opt/conda/lib/python3.8/site-packages/albumentations/augmentations/functional.py", line 7, in <module>
    import cv2
  File "/opt/conda/lib/python3.8/site-packages/cv2/__init__.py", line 5, in <module>
    from .cv2 import *

I resolved this issue with the command

apt-get install libgl1

But then I am getting an index error, After printing the idx, in the TrainPreDataset.getitem function, this is the output.

Epoch 0:   0%|                                                                                 | 0/652 [00:00<?, ?it/s]
------>idx:  7880
------>idx:  3611
------>idx:  2916
------>idx:  6289
------>idx:  8301
------>idx:  4774
------>idx:  2625
------>idx:  7334
------>idx:  7379
------>idx:  8538
------>idx:  5376
------>idx:  1684
------>idx:  4964
------>idx:  1204
------>idx:  4311
------>idx:  452
Traceback (most recent call last):
  File "main.py", line 114, in <module>
------>idx:  557
    trainer.fit(model, data_module)

These idx are read from the utils/index.csv which contains 8566 entries, but the total images in my data are 8130. I don't how this csv file is used. ANY SOLUTION????

alph-a07 commented 4 months ago

were you able to train the model successfully?

RishabhBajaj25 commented 3 days ago

You have to run utils/generate_idx.py to generate the .csv file for your training set.