AttributeError: Attribute 'statistics' does not exist in the metadata of dataset 'VG_train'. Available keys are dict_keys(['name', 'thing_classes', 'predicate_classes', 'attribute_classes']).
Snak0067 opened this issue · 8 comments
Thanks to the author for the excellent code and SGG's new contribution, but there is a problem when reproducing it.
AttributeError: Attribute 'statistics' does not exist in the metadata of dataset 'VG_train'. Available keys are dict_keys(['name ', 'thing_classes', 'predicate_classes', 'attribute_classes']).
DATASETS:
TYPE: "VISUAL GENOME"
TRAIN: ('VG_train',)
TEST: ('VG_test',)
VISUAL_GENOME:
TRAIN_MASKS: ""
VAL_MASKS: ""
TEST_MASKS: ""
FILTER_EMPTY_RELATIONS: True
FILTER_NON_OVERLAP: False
FILTER_DUPLICATE_RELATIONS: True
IMAGES: './data/datasets/VG/VG_100K/'
MAPPING_DICTIONARY: './data/datasets/VG/VG-SGG-dicts-with-attri.json'
IMAGE_DATA: './data/datasets/VG/image_data.json'
VG_ATTRIBUTE_H5: './data/datasets/VG/VG-SGG-with-attri.h5'
Check the config file and see that there are no other parameters in TRAIN of DATASETS. Is there something wrong?
Hi,I also get the same error.Do you find some suggestions to solve this problem?
Thanks to the author for the excellent code and SGG's new contribution, but there is a problem when reproducing it. AttributeError: Attribute 'statistics' does not exist in the metadata of dataset 'VG_train'. Available keys are dict_keys(['name ', 'thing_classes', 'predicate_classes', 'attribute_classes']).
DATASETS: TYPE: "VISUAL GENOME" TRAIN: ('VG_train',) TEST: ('VG_test',) VISUAL_GENOME: TRAIN_MASKS: "" VAL_MASKS: "" TEST_MASKS: "" FILTER_EMPTY_RELATIONS: True FILTER_NON_OVERLAP: False FILTER_DUPLICATE_RELATIONS: True IMAGES: './data/datasets/VG/VG_100K/' MAPPING_DICTIONARY: './data/datasets/VG/VG-SGG-dicts-with-attri.json' IMAGE_DATA: './data/datasets/VG/image_data.json' VG_ATTRIBUTE_H5: './data/datasets/VG/VG-SGG-with-attri.h5'
Check the config file and see that there are no other parameters in TRAIN of DATASETS. Is there something wrong?
i found the suggestions in ubc-vision/IterativeSG#6 (comment) could do this to fix the issue
Yes, he and I had the same problem, thanks for your valuable advice;But he didn't seem to provide any solutions, so I have to think about it again.
in SpeaQ/modeling/meta_arch/detr.py , add code below
from data.datasets.visual_genome import VisualGenomeTrainData
# statistics = MetadataCatalog.get(cfg.DATASETS.TRAIN[0]).statistics
vg_train_data = VisualGenomeTrainData(cfg, split='test')
statistics = vg_train_data.get_statistics()
Maybe it can solve this problem
SpeaQ/data/datasets/visual_genome.py. 111 line
if not dataloader:
try:
DatasetCatalog.register('VG_{}'.format(self.split), lambda: self.dataset_dicts)
except:
pass
the bug maybe by the version of numpy.Some types in new numpy are deprecated.You can do these to solve the problem.
SpeaQ/data/datasets/visual_genome.py. 406 line
# FIXME statiistics bug
# FIX fix the The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
# overlaps = bbox_overlaps(boxes.astype(np.float), boxes.astype(np.float), to_move=0) > 0
overlaps = bbox_overlaps(boxes.astype(np.float64), boxes.astype(np.float64), to_move=0) > 0
np.fill_diagonal(overlaps, 0)
SpeaQ/data/datasets/visual_genome.py. 411 line
# FIXME statistics bug
# all_possib = np.ones_like(overlaps, dtype=np.bool)
all_possib = np.ones_like(overlaps, dtype=np.bool_)
Hi, as of my knowledge, it appears that the error is due to an incompatible version of NumPy.
Could you please try installing NumPy version 1.21.6 and see if that resolves the problem?
Installing with pip install numpy==1.21.6
has solved the error for me.
Hi, thank you for your suggestion. It helps me a lot. The key to the problem is the version of numpy. numpy==1.21.6 can effectively solve this problem.