Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to disable semantic mask since I only want to do object detection? #42

Open
Icecream-blue-sky opened this issue Sep 13, 2021 · 1 comment

Comments

@Icecream-blue-sky
Copy link

When I simply "python tools/trian.py configs/cbnet/htc_cbv2_swin_large_patch4_window7_mstrain_400 1400_giou_4conv1f_adamw_1x_coco.py", I get the error:

Traceback (most recent call last):
  File "tools/train.py", line 188, in <module>
    main()
  File "tools/train.py", line 184, in main
    meta=meta)
  File "/gpfs/home/sist/tqzouustc/code/CBNetV2/mmdet/apis/train.py", line 185, in train_detector
    runner.run(data_loaders, cfg.workflow)
  File "/home/sist/tqzouustc/.conda/envs/CBNet_a100/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 127, in run
    epoch_runner(data_loaders[i], **kwargs)
  File "/home/sist/tqzouustc/.conda/envs/CBNet_a100/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 50, in train
    self.run_iter(data_batch, train_mode=True, **kwargs)
  File "/home/sist/tqzouustc/.conda/envs/CBNet_a100/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 30, in run_iter
    **kwargs)
  File "/home/sist/tqzouustc/.conda/envs/CBNet_a100/lib/python3.7/site-packages/mmcv/parallel/data_parallel.py", line 67, in train_step
    return self.module.train_step(*inputs[0], **kwargs[0])
  File "/gpfs/home/sist/tqzouustc/code/CBNetV2/mmdet/models/detectors/base.py", line 237, in train_step
    losses = self(**data)
  File "/home/sist/tqzouustc/.conda/envs/CBNet_a100/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/home/sist/tqzouustc/.conda/envs/CBNet_a100/lib/python3.7/site-packages/mmcv/runner/fp16_utils.py", line 128, in new_func
    output = old_func(*new_args, **new_kwargs)
  File "/gpfs/home/sist/tqzouustc/code/CBNetV2/mmdet/models/detectors/base.py", line 171, in forward
    return self.forward_train(img, img_metas, **kwargs)
  File "/gpfs/home/sist/tqzouustc/code/CBNetV2/mmdet/models/detectors/two_stage.py", line 266, in forward_train
    **kwargs)
  File "/gpfs/home/sist/tqzouustc/code/CBNetV2/mmdet/models/roi_heads/htc_roi_head.py", line 245, in forward_train
    loss_seg = self.semantic_head.loss(semantic_pred, gt_semantic_seg)
  File "/home/sist/tqzouustc/.conda/envs/CBNet_a100/lib/python3.7/site-packages/mmcv/runner/fp16_utils.py", line 214, in new_func
    output = old_func(*new_args, **new_kwargs)
  File "/gpfs/home/sist/tqzouustc/code/CBNetV2/mmdet/models/roi_heads/mask_heads/fused_semantic_head.py", line 103, in loss
    labels = labels.squeeze(1).long()
AttributeError: 'NoneType' object has no attribute 'squeeze'

It seems to caused by semantic mask. How could I fix it?

@ttrungtin2910
Copy link

Can you solve this problem? Please share with me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants