Skip to content

test_nms_thresh and test_detections_per_img might be not defined in TridentNet #1220

@tkm-n

Description

@tkm-n

Hi, I want to evaluate trained TridentNet, I can train on my environment according to the instruction, but I cannot evaluate it. And, I found test_nms_thresh and test_detections_per_img might be not defined in "TridentRes5ROIHeads".

In detail, I ran the following command,

python train_net.py --config-file configs/tridentnet_fast_R_50_C4_1x.yaml --num-gpus 1 --eval-only MODEL.WEIGHTS output/model_0029999.pth
Then, I got this message,

[04/15 08:17:54 d2.data.common]: Serializing 5000 elements to byte tensors and concatenating them all ...
[04/15 08:17:54 d2.data.common]: Serialized dataset takes 19.39 MiB
[04/15 08:17:55 d2.evaluation.evaluator]: Start inference on 5000 images
Traceback (most recent call last):
  File "train_net.py", line 66, in <module>
    args=(args,),
  File "/detectron2/detectron2/engine/launch.py", line 52, in launch
    main_func(*args)
  File "train_net.py", line 49, in main
    res = Trainer.test(cfg, model)
  File "/detectron2/detectron2/engine/defaults.py", line 514, in test
    results_i = inference_on_dataset(model, data_loader, evaluator)
  File "/detectron2/detectron2/evaluation/evaluator.py", line 141, in inference_on_dataset
    outputs = model(inputs)
  File "/anaconda3/envs/detectron2/lib/python3.7/site-packages/torch/nn/modules/module.py", line 532, in __call__
    result = self.forward(*input, **kwargs)
  File "/detectron2/detectron2/modeling/meta_arch/rcnn.py", line 108, in forward
    return self.inference(batched_inputs)
  File "/detectron2/detectron2/modeling/meta_arch/rcnn.py", line 170, in inference
    results, _ = self.roi_heads(images, features, proposals, None)
  File "/anaconda3/envs/detectron2/lib/python3.7/site-packages/torch/nn/modules/module.py", line 532, in __call__
    result = self.forward(*input, **kwargs)
  File "/detectron2/projects/TridentNet/tridentnet/trident_rcnn.py", line 73, in forward
    pred_instances, num_branch, self.test_nms_thresh, self.test_detections_per_img
  File "/anaconda3/envs/detectron2/lib/python3.7/site-packages/torch/nn/modules/module.py", line 576, in __getattr__
    type(self).__name__, name))
AttributeError: 'TridentRes5ROIHeads' object has no attribute 'test_nms_thresh'

At that time, I used COCO dataset 2017 version, and I slightly changed the config file as below;
IMS_PER_BATCH: 3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions