utkarshmall13 / CACo

official code for CVPR 2023 paper 'Change-Aware Sampling and Contrastive Learning for Satellite Images'
MIT License
46 stars 7 forks source link

lmdb.Error: datasets/clean_10k_geography/train.lmdb: No such file or directory #5

Open AIHECKER opened 6 months ago

AIHECKER commented 6 months ago

I got the same problem in Seco's source code. I thought the author probably sovled this, so I'm here asking for help!

utkarshmall13 commented 6 months ago

Hi, can you also post the command (with argument) and model you are trying to run? I was getting this error but was able to resolve it but I don't remember exactly when I was getting it.

AIHECKER commented 6 months ago

Hi, can you also post the command (with argument) and model you are trying to run? I was getting this error but was able to resolve it but I don't remember exactly when I was getting it.

Thanks for replying. I was running the main_pretrain.py using this command: python3 main_pretrain.py --data_dir datasets/clean_10k_geography/ --base_encoder resnet18 --batch_size 256 --data_mode caco --max_epochs 1000 --schedule 600 800 -d gereric_description --online_data_dir datasets/clean_10k_geography/

I added the new argument --online data_dir which you didn't put it on in your original command because the program couldn't go on without this.

And the complete error message wrote like this: (cacoenv) u2021213473@n1:~/jupyterlab/seasonal-contrast-main$ python3 main_pretrain.py --data_dir datasets/clean_10k_geography/ --base_encoder resnet18 --batch_size 256 --data_mode caco --max_epochs 1000 --schedule 600 800 -d gereric_description --online_data_dir datasets/clean_10k_geography/ {'min_q': {'B2': 3.0, 'B3': 2.0, 'B4': 0.0}, 'max_q': {'B2': 88.0, 'B3': 103.0, 'B4': 129.0}} Traceback (most recent call last): File "/home/u2021213473/jupyterlab/seasonal-contrast-main/main_pretrain.py", line 89, in online_evaluator = SSLOnlineEvaluator( File "/home/u2021213473/jupyterlab/seasonal-contrast-main/models/ssl_online.py", line 25, in init self.datamodule.setup() File "/home/u2021213473/.local/lib/python3.9/site-packages/pytorch_lightning/core/datamodule.py", line 92, in wrapped_fn return fn(*args, **kwargs) File "/home/u2021213473/jupyterlab/seasonal-contrast-main/datasets/bigearthnet_datamodule.py", line 36, in setup self.train_dataset = LMDBDataset( File "/home/u2021213473/jupyterlab/seasonal-contrast-main/utils/data.py", line 91, in init self.env = lmdb.open(lmdb_file, max_readers=1, readonly=True, lock=False, readahead=False, meminit=False) lmdb.Error: datasets/clean_10k_geography/train.lmdb: No such file or directory

utkarshmall13 commented 6 months ago

Sorry, dropped the ball on this one. Were you able to figure it out? I think the --online_data_dir is the culprit as the lmdb version of data is needed for that.

AIHECKER commented 6 months ago

Sorry, dropped the ball on this one. Were you able to figure it out? I think the --online_data_dir is the culprit as the lmdb version of data is needed for that.

Thanks for the heads-up. I took a look at the models/ssl_online.py file and noticed that a return statement is executed right before the self.datamodule section. This is a change from the original SECO code. (You must have figured this out.) So, problem solved!