You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "/home/ubuntu/Trainer/detectron2/detectron2/engine/train_loop.py", line 149, in train
self.run_step()
File "/home/ubuntu/Trainer/detectron2/detectron2/engine/train_loop.py", line 404, in run_step
data = next(self._data_loader_iter)
File "/home/ubuntu/Trainer/detectron2/detectron2/data/common.py", line 234, in __iter__
for d in self.dataset:
File "/home/ubuntu/miniconda3/envs/detectron/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 517, in __next__
data = self._next_data()
File "/home/ubuntu/miniconda3/envs/detectron/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1199, in _next_data
return self._process_data(data)
File "/home/ubuntu/miniconda3/envs/detectron/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1225, in _process_data
data.reraise()
File "/home/ubuntu/miniconda3/envs/detectron/lib/python3.8/site-packages/torch/_utils.py", line 429, in reraise
raise self.exc_type(msg)
AttributeError: Caught AttributeError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/home/ubuntu/miniconda3/envs/detectron/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 202, in _worker_loop
data = fetcher.fetch(index)
File "/home/ubuntu/miniconda3/envs/detectron/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 28, in fetch
data.append(next(self.dataset_iter))
File "/home/ubuntu/Trainer/detectron2/detectron2/data/common.py", line 201, in __iter__
yield self.dataset[idx]
File "/home/ubuntu/Trainer/detectron2/detectron2/data/common.py", line 90, in __getitem__
data = self._map_func(self._dataset[cur_idx])
File "/home/ubuntu/Trainer/detectron2/detectron2/utils/serialize.py", line 26, in __call__
return self._obj(*args, **kwargs)
File "/home/ubuntu/Trainer/detectron2/detectron2/data/dataset_mapper.py", line 189, in __call__
self._transform_annotations(dataset_dict, transforms, image_shape)
File "/home/ubuntu/Trainer/detectron2/detectron2/data/dataset_mapper.py", line 141, in _transform_annotations
instances.gt_boxes = instances.gt_masks.get_bounding_boxes()
File "/home/ubuntu/Trainer/detectron2/detectron2/structures/instances.py", line 68, in __getattr__
raise AttributeError("Cannot find field '{}' in the given Instances!".format(name))
AttributeError: Cannot find field 'gt_masks' in the given Instances!
Expected behavior:
The model should start training without issue. I referred to #485 , but I'm using a detection model with bbox annotations.
Not sure what is going on. The model weights from "detectron2://COCO-Detection/faster_rcnn_R_50_FPN_3x/137849458/model_final_280758.pkl" load fine, too.
A sample of my dataset:
Okay, looks like I found the issue: recompute_boxes requires gt_masks to get tighter bounding boxes when cropping.
I removed that and it seems to work fine now.
Follow-up question: when using the ResizeShortestEdge augmentation, I assume the bounding boxes are automatically scaled. Is this true? And is there any way to use cropping and recomputing bboxes when gt_mask isn't available?
If you do not know the root cause of the problem, please post according to this template:
Instructions To Reproduce the Issue:
Check https://stackoverflow.com/help/minimal-reproducible-example for how to ask good questions.
Simplify the steps to reproduce the issue using suggestions from the above link, and provide them below:
Here's my model config, based on the mask rcnn config provided, with the mask heads removed:
Here's the model output during runtime:
Expected behavior:
The model should start training without issue. I referred to #485 , but I'm using a detection model with bbox annotations.
Not sure what is going on. The model weights from "detectron2://COCO-Detection/faster_rcnn_R_50_FPN_3x/137849458/model_final_280758.pkl" load fine, too.
A sample of my dataset:
Environment:
The detectron2 is locally built from a fork without any changes.
The text was updated successfully, but these errors were encountered: