ubc-vision / IterativeSG

19 stars 2 forks source link

AttributeError during the training and inference. #6

Open Scarecrow0 opened 1 year ago

Scarecrow0 commented 1 year ago

the full error message :

Traceback (most recent call last):
  File "train_iterative_model.py", line 68, in <module>
    launch(
  File "/public/home/lirj2/projects/IterativeSG/detectron2/detectron2/engine/launch.py", line 84, in launch
    main_func(*args)
  File "train_iterative_model.py", line 49, in main
    trainer = JointTransformerTrainer(cfg)
  File "/public/home/lirj2/projects/IterativeSG/detectron2/detectron2/engine/defaults.py", line 376, in __init__
    model = self.build_model(cfg)
  File "/public/home/lirj2/projects/IterativeSG/detectron2/detectron2/engine/defaults.py", line 514, in build_model
    model = build_model(cfg)
  File "/public/home/lirj2/projects/IterativeSG/detectron2/detectron2/modeling/meta_arch/build.py", line 22, in build_model
    model = META_ARCH_REGISTRY.get(meta_arch)(cfg)
  File "/public/home/lirj2/projects/IterativeSG/../IterativeSG/modeling/meta_arch/detr.py", line 115, in __init__
    statistics = MetadataCatalog.get(cfg.DATASETS.TRAIN[0]).statistics
  File "/public/home/lirj2/projects/IterativeSG/detectron2/detectron2/data/catalog.py", line 126, in __getattr__
    raise AttributeError(
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']).
(torch182)
aryanmangal769 commented 1 year ago

Hi @Scarecrow0 did you find the solution to this problem?

Scarecrow0 commented 1 year ago

@aryanmangal769

An error occurred while calling self.get_statistics(). Remove the try-except, and you will see the error caused by the dtype conversion of numpy. https://github.com/ubc-vision/IterativeSG/blob/7abd162cb8e510cfbcededbeb18b36b54f381189/data/datasets/visual_genome.py#L49