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
hello @gkioxari,
I am trying train with my custom dataset with coco format Json. I have modified the dataloader with respect to my dataset. I am getting the following error while training. [01/24 15:40:57 d2.engine.train_loop]: Starting training from iteration 0 /home/nishantha/test/meshrcnn/meshrcnn/structures/voxel.py:68: UserWarning: This overload of nonzero is deprecated: nonzero() Consider using one of the following signatures instead: nonzero(*, bool as_tuple) (Triggered internally at /opt/conda/conda-bld/pytorch_1595629395347/work/torch/csrc/utils/python_arg_parser.cpp:766.) item = item.nonzero() /home/nishantha/test/meshrcnn/meshrcnn/structures/voxel.py:68: UserWarning: This overload of nonzero is deprecated: nonzero() Consider using one of the following signatures instead: nonzero(*, bool as_tuple) (Triggered internally at /opt/conda/conda-bld/pytorch_1595629395347/work/torch/csrc/utils/python_arg_parser.cpp:766.) item = item.nonzero() /home/nishantha/test/meshrcnn/meshrcnn/structures/voxel.py:68: UserWarning: This overload of nonzero is deprecated: nonzero() Consider using one of the following signatures instead: nonzero(*, bool as_tuple) (Triggered internally at /opt/conda/conda-bld/pytorch_1595629395347/work/torch/csrc/utils/python_arg_parser.cpp:766.) item = item.nonzero() /home/nishantha/miniconda3/lib/python3.8/site-packages/detectron2/modeling/roi_heads/fast_rcnn.py:217: UserWarning: This overload of nonzero is deprecated: nonzero() Consider using one of the following signatures instead: nonzero(*, bool as_tuple) (Triggered internally at /opt/conda/conda-bld/pytorch_1595629395347/work/torch/csrc/utils/python_arg_parser.cpp:766.) num_fg = fg_inds.nonzero().numel() /home/nishantha/miniconda3/lib/python3.8/site-packages/torch/nn/functional.py:3118: UserWarning: Default upsampling behavior when mode=bilinear is changed to align_corners=False since 0.4.0. Please specify align_corners=True if the old behavior is desired. See the documentation of nn.Upsample for details. warnings.warn("Default upsampling behavior when mode={} is changed " ERROR [01/24 15:41:00 d2.engine.train_loop]: Exception during training: Traceback (most recent call last): File "/home/nishantha/miniconda3/lib/python3.8/site-packages/detectron2/engine/train_loop.py", line 134, in train self.run_step() File "/home/nishantha/miniconda3/lib/python3.8/site-packages/detectron2/engine/defaults.py", line 423, in run_step self._trainer.run_step() File "/home/nishantha/miniconda3/lib/python3.8/site-packages/detectron2/engine/train_loop.py", line 228, in run_step loss_dict = self.model(data) File "/home/nishantha/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 722, in _call_impl result = self.forward(*input, **kwargs) File "/home/nishantha/miniconda3/lib/python3.8/site-packages/detectron2/modeling/meta_arch/rcnn.py", line 166, in forward _, detector_losses = self.roi_heads(images, features, proposals, gt_instances) File "/home/nishantha/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 722, in _call_impl result = self.forward(*input, **kwargs) File "/home/nishantha/test/meshrcnn/meshrcnn/modeling/roi_heads/roi_heads.py", line 153, in forward losses.update(self._forward_mask(features, proposals)) File "/home/nishantha/test/meshrcnn/meshrcnn/modeling/roi_heads/roi_heads.py", line 243, in _forward_mask loss_mask, target_masks = mask_rcnn_loss(mask_logits, proposals) File "/home/nishantha/test/meshrcnn/meshrcnn/modeling/roi_heads/mask_head.py", line 42, in mask_rcnn_loss gt_masks_per_image = batch_crop_masks_within_box( File "/home/nishantha/test/meshrcnn/meshrcnn/structures/mask.py", line 59, in batch_crop_masks_within_box results = [crop_mask_within_box(mask, box, mask_side_len) for mask, box in zip(masks, boxes)] File "/home/nishantha/test/meshrcnn/meshrcnn/structures/mask.py", line 59, in <listcomp> results = [crop_mask_within_box(mask, box, mask_side_len) for mask, box in zip(masks, boxes)] File "/home/nishantha/test/meshrcnn/meshrcnn/structures/mask.py", line 31, in crop_mask_within_box cropped_mask = F.interpolate(cropped_mask, size=(mask_size, mask_size), mode="bilinear") File "/home/nishantha/miniconda3/lib/python3.8/site-packages/torch/nn/functional.py", line 3169, in interpolate raise NotImplementedError("Got 5D input, but bilinear mode needs 4D input") NotImplementedError: Got 5D input, but bilinear mode needs 4D input [01/24 15:41:00 d2.engine.hooks]: Total training time: 0:00:02 (0:00:00 on hooks) [01/24 15:41:00 d2.utils.events]: iter: 0 lr: N/A max_mem: 2901M Traceback (most recent call last): File "tools/train_net.py", line 102, in <module> launch( File "/home/nishantha/miniconda3/lib/python3.8/site-packages/detectron2/engine/launch.py", line 62, in launch main_func(*args) File "tools/train_net.py", line 96, in main return trainer.train() File "/home/nishantha/miniconda3/lib/python3.8/site-packages/detectron2/engine/defaults.py", line 413, in train super().train(self.start_iter, self.max_iter) File "/home/nishantha/miniconda3/lib/python3.8/site-packages/detectron2/engine/train_loop.py", line 134, in train self.run_step() File "/home/nishantha/miniconda3/lib/python3.8/site-packages/detectron2/engine/defaults.py", line 423, in run_step self._trainer.run_step() File "/home/nishantha/miniconda3/lib/python3.8/site-packages/detectron2/engine/train_loop.py", line 228, in run_step loss_dict = self.model(data) File "/home/nishantha/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 722, in _call_impl result = self.forward(*input, **kwargs) File "/home/nishantha/miniconda3/lib/python3.8/site-packages/detectron2/modeling/meta_arch/rcnn.py", line 166, in forward _, detector_losses = self.roi_heads(images, features, proposals, gt_instances) File "/home/nishantha/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 722, in _call_impl result = self.forward(*input, **kwargs) File "/home/nishantha/test/meshrcnn/meshrcnn/modeling/roi_heads/roi_heads.py", line 153, in forward losses.update(self._forward_mask(features, proposals)) File "/home/nishantha/test/meshrcnn/meshrcnn/modeling/roi_heads/roi_heads.py", line 243, in _forward_mask loss_mask, target_masks = mask_rcnn_loss(mask_logits, proposals) File "/home/nishantha/test/meshrcnn/meshrcnn/modeling/roi_heads/mask_head.py", line 42, in mask_rcnn_loss gt_masks_per_image = batch_crop_masks_within_box( File "/home/nishantha/test/meshrcnn/meshrcnn/structures/mask.py", line 59, in batch_crop_masks_within_box results = [crop_mask_within_box(mask, box, mask_side_len) for mask, box in zip(masks, boxes)] File "/home/nishantha/test/meshrcnn/meshrcnn/structures/mask.py", line 59, in <listcomp> results = [crop_mask_within_box(mask, box, mask_side_len) for mask, box in zip(masks, boxes)] File "/home/nishantha/test/meshrcnn/meshrcnn/structures/mask.py", line 31, in crop_mask_within_box cropped_mask = F.interpolate(cropped_mask, size=(mask_size, mask_size), mode="bilinear") File "/home/nishantha/miniconda3/lib/python3.8/site-packages/torch/nn/functional.py", line 3169, in interpolate raise NotImplementedError("Got 5D input, but bilinear mode needs 4D input") NotImplementedError: Got 5D input, but bilinear mode needs 4D input
Error is caused by line 31 of mask.py (cropped_mask = F.interpolate(cropped_mask, size=(mask_size, mask_size), mode="bilinear"). My custom dataset contains masks of the object similar to that of Pix3d dataset. Can you please help me resolve this error?
The text was updated successfully, but these errors were encountered:
Nishantha8
changed the title
Assertion t >= 0 && t < n_classes failed error while training with custom dataset
NotImplementedError: Got 5D input, but bilinear mode needs 4D input error while training with custom dataset
Jan 24, 2022
hello @gkioxari,
I am trying train with my custom dataset with coco format Json. I have modified the dataloader with respect to my dataset. I am getting the following error while training.
[01/24 15:40:57 d2.engine.train_loop]: Starting training from iteration 0 /home/nishantha/test/meshrcnn/meshrcnn/structures/voxel.py:68: UserWarning: This overload of nonzero is deprecated: nonzero() Consider using one of the following signatures instead: nonzero(*, bool as_tuple) (Triggered internally at /opt/conda/conda-bld/pytorch_1595629395347/work/torch/csrc/utils/python_arg_parser.cpp:766.) item = item.nonzero() /home/nishantha/test/meshrcnn/meshrcnn/structures/voxel.py:68: UserWarning: This overload of nonzero is deprecated: nonzero() Consider using one of the following signatures instead: nonzero(*, bool as_tuple) (Triggered internally at /opt/conda/conda-bld/pytorch_1595629395347/work/torch/csrc/utils/python_arg_parser.cpp:766.) item = item.nonzero() /home/nishantha/test/meshrcnn/meshrcnn/structures/voxel.py:68: UserWarning: This overload of nonzero is deprecated: nonzero() Consider using one of the following signatures instead: nonzero(*, bool as_tuple) (Triggered internally at /opt/conda/conda-bld/pytorch_1595629395347/work/torch/csrc/utils/python_arg_parser.cpp:766.) item = item.nonzero() /home/nishantha/miniconda3/lib/python3.8/site-packages/detectron2/modeling/roi_heads/fast_rcnn.py:217: UserWarning: This overload of nonzero is deprecated: nonzero() Consider using one of the following signatures instead: nonzero(*, bool as_tuple) (Triggered internally at /opt/conda/conda-bld/pytorch_1595629395347/work/torch/csrc/utils/python_arg_parser.cpp:766.) num_fg = fg_inds.nonzero().numel() /home/nishantha/miniconda3/lib/python3.8/site-packages/torch/nn/functional.py:3118: UserWarning: Default upsampling behavior when mode=bilinear is changed to align_corners=False since 0.4.0. Please specify align_corners=True if the old behavior is desired. See the documentation of nn.Upsample for details. warnings.warn("Default upsampling behavior when mode={} is changed " ERROR [01/24 15:41:00 d2.engine.train_loop]: Exception during training: Traceback (most recent call last): File "/home/nishantha/miniconda3/lib/python3.8/site-packages/detectron2/engine/train_loop.py", line 134, in train self.run_step() File "/home/nishantha/miniconda3/lib/python3.8/site-packages/detectron2/engine/defaults.py", line 423, in run_step self._trainer.run_step() File "/home/nishantha/miniconda3/lib/python3.8/site-packages/detectron2/engine/train_loop.py", line 228, in run_step loss_dict = self.model(data) File "/home/nishantha/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 722, in _call_impl result = self.forward(*input, **kwargs) File "/home/nishantha/miniconda3/lib/python3.8/site-packages/detectron2/modeling/meta_arch/rcnn.py", line 166, in forward _, detector_losses = self.roi_heads(images, features, proposals, gt_instances) File "/home/nishantha/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 722, in _call_impl result = self.forward(*input, **kwargs) File "/home/nishantha/test/meshrcnn/meshrcnn/modeling/roi_heads/roi_heads.py", line 153, in forward losses.update(self._forward_mask(features, proposals)) File "/home/nishantha/test/meshrcnn/meshrcnn/modeling/roi_heads/roi_heads.py", line 243, in _forward_mask loss_mask, target_masks = mask_rcnn_loss(mask_logits, proposals) File "/home/nishantha/test/meshrcnn/meshrcnn/modeling/roi_heads/mask_head.py", line 42, in mask_rcnn_loss gt_masks_per_image = batch_crop_masks_within_box( File "/home/nishantha/test/meshrcnn/meshrcnn/structures/mask.py", line 59, in batch_crop_masks_within_box results = [crop_mask_within_box(mask, box, mask_side_len) for mask, box in zip(masks, boxes)] File "/home/nishantha/test/meshrcnn/meshrcnn/structures/mask.py", line 59, in <listcomp> results = [crop_mask_within_box(mask, box, mask_side_len) for mask, box in zip(masks, boxes)] File "/home/nishantha/test/meshrcnn/meshrcnn/structures/mask.py", line 31, in crop_mask_within_box cropped_mask = F.interpolate(cropped_mask, size=(mask_size, mask_size), mode="bilinear") File "/home/nishantha/miniconda3/lib/python3.8/site-packages/torch/nn/functional.py", line 3169, in interpolate raise NotImplementedError("Got 5D input, but bilinear mode needs 4D input") NotImplementedError: Got 5D input, but bilinear mode needs 4D input [01/24 15:41:00 d2.engine.hooks]: Total training time: 0:00:02 (0:00:00 on hooks) [01/24 15:41:00 d2.utils.events]: iter: 0 lr: N/A max_mem: 2901M Traceback (most recent call last): File "tools/train_net.py", line 102, in <module> launch( File "/home/nishantha/miniconda3/lib/python3.8/site-packages/detectron2/engine/launch.py", line 62, in launch main_func(*args) File "tools/train_net.py", line 96, in main return trainer.train() File "/home/nishantha/miniconda3/lib/python3.8/site-packages/detectron2/engine/defaults.py", line 413, in train super().train(self.start_iter, self.max_iter) File "/home/nishantha/miniconda3/lib/python3.8/site-packages/detectron2/engine/train_loop.py", line 134, in train self.run_step() File "/home/nishantha/miniconda3/lib/python3.8/site-packages/detectron2/engine/defaults.py", line 423, in run_step self._trainer.run_step() File "/home/nishantha/miniconda3/lib/python3.8/site-packages/detectron2/engine/train_loop.py", line 228, in run_step loss_dict = self.model(data) File "/home/nishantha/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 722, in _call_impl result = self.forward(*input, **kwargs) File "/home/nishantha/miniconda3/lib/python3.8/site-packages/detectron2/modeling/meta_arch/rcnn.py", line 166, in forward _, detector_losses = self.roi_heads(images, features, proposals, gt_instances) File "/home/nishantha/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 722, in _call_impl result = self.forward(*input, **kwargs) File "/home/nishantha/test/meshrcnn/meshrcnn/modeling/roi_heads/roi_heads.py", line 153, in forward losses.update(self._forward_mask(features, proposals)) File "/home/nishantha/test/meshrcnn/meshrcnn/modeling/roi_heads/roi_heads.py", line 243, in _forward_mask loss_mask, target_masks = mask_rcnn_loss(mask_logits, proposals) File "/home/nishantha/test/meshrcnn/meshrcnn/modeling/roi_heads/mask_head.py", line 42, in mask_rcnn_loss gt_masks_per_image = batch_crop_masks_within_box( File "/home/nishantha/test/meshrcnn/meshrcnn/structures/mask.py", line 59, in batch_crop_masks_within_box results = [crop_mask_within_box(mask, box, mask_side_len) for mask, box in zip(masks, boxes)] File "/home/nishantha/test/meshrcnn/meshrcnn/structures/mask.py", line 59, in <listcomp> results = [crop_mask_within_box(mask, box, mask_side_len) for mask, box in zip(masks, boxes)] File "/home/nishantha/test/meshrcnn/meshrcnn/structures/mask.py", line 31, in crop_mask_within_box cropped_mask = F.interpolate(cropped_mask, size=(mask_size, mask_size), mode="bilinear") File "/home/nishantha/miniconda3/lib/python3.8/site-packages/torch/nn/functional.py", line 3169, in interpolate raise NotImplementedError("Got 5D input, but bilinear mode needs 4D input") NotImplementedError: Got 5D input, but bilinear mode needs 4D input
Error is caused by line 31 of mask.py (cropped_mask = F.interpolate(cropped_mask, size=(mask_size, mask_size), mode="bilinear"). My custom dataset contains masks of the object similar to that of Pix3d dataset. Can you please help me resolve this error?
The text was updated successfully, but these errors were encountered: