ChenRocks / UNITER

Research code for ECCV 2020 paper "UNITER: UNiversal Image-TExt Representation Learning"
https://arxiv.org/abs/1909.11740
777 stars 109 forks source link

AttributeError: 'DetectFeatLmdb' object has no attribute 'env' #70

Open FightingFighting opened 3 years ago

FightingFighting commented 3 years ago

when I run python train_re.py --config config/train-refcoco-base-1gpu.json --output_dir $RE_EXP

I just get this result.

03/11/2021 11:44:06 - INFO - main - Loading Train Dataset /txt_db/refcoco_train.db, /img_db/re_coco_gt /img_db/re_coco_gt /txt_db/refcoco_train.db Traceback (most recent call last): File "train_re.py", line 461, in main(args) File "train_re.py", line 129, in main ReDataset, re_collate, opts) File "train_re.py", line 46, in create_dataloader num_bb, opts.compressed_db) File "/src/data/data.py", line 75, in init readahead=not _check_distributed()) lmdb.Error: /img_db/re_coco_gt/feat_numbb100: No such file or directory Exception ignored in: <bound method DetectFeatLmdb.del of <data.data.DetectFeatLmdb object at 0x7f165ddb5940>> Traceback (most recent call last): File "/src/data/data.py", line 98, in del self.env.close() AttributeError: 'DetectFeatLmdb' object has no attribute 'env'

Does anyone know this?

wangxiao5791509 commented 3 years ago

when I run python train_re.py --config config/train-refcoco-base-1gpu.json --output_dir $RE_EXP

I just get this result.

03/11/2021 11:44:06 - INFO - main - Loading Train Dataset /txt_db/refcoco_train.db, /img_db/re_coco_gt /img_db/re_coco_gt /txt_db/refcoco_train.db Traceback (most recent call last): File "train_re.py", line 461, in main(args) File "train_re.py", line 129, in main ReDataset, re_collate, opts) File "train_re.py", line 46, in create_dataloader num_bb, opts.compressed_db) File "/src/data/data.py", line 75, in init readahead=not _check_distributed()) lmdb.Error: /img_db/re_coco_gt/feat_numbb100: No such file or directory Exception ignored in: <bound method DetectFeatLmdb.del of <data.data.DetectFeatLmdb object at 0x7f165ddb5940>> Traceback (most recent call last): File "/src/data/data.py", line 98, in del self.env.close() AttributeError: 'DetectFeatLmdb' object has no attribute 'env'

Does anyone know this?

I also meet this issue, do you solve this problem?

shivangibithel commented 2 years ago

I am getting the same error. Were you able to solve this? @wangxiao5791509 @FightingFighting

wangxiao5791509 commented 2 years ago

@shivangibithel I changed to follow Oscar and VINVL model for vision-language pretraining.

FightingFighting commented 2 years ago

@shivangibithel this problem is because the failure to read the lmdb file, you can try to read lmdb file at first.

LongxingHu commented 2 years ago

note that "lmdb.Error: /img_db/re_coco_gt/feat_numbb100: No such file or directory" in your error message. You are supposed to change your directory in /config/train-refcoco-base-1gpu.json if your command parament is that config file