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

The shape mismatch in evaluation #79

Open
WenlongZhang0517 opened this issue Aug 14, 2023 · 1 comment
Open

The shape mismatch in evaluation #79

WenlongZhang0517 opened this issue Aug 14, 2023 · 1 comment

Comments

@WenlongZhang0517
Copy link

**I encountered a simple bug when evaluating. How can this problem be solved? It seems like 817920 is three times as much as 272540. **


/home/user/anaconda3/envs/xdecoder/lib/python3.9/site-packages/detectron2/structures/image_list.py:88: UserWarning: __floordiv__ is deprecated, and its behavior will change in a future version of pytorch. It currently rounds toward 0 (like the 'trunc' function NOT 'floor'). This results in incorrect rounding for negative values. To keep the current behavior, use torch.div(a, b, rounding_mode='trunc'), or for actual floor division, use torch.div(a, b, rounding_mode='floor').
  max_size = (max_size + (stride - 1)) // stride * stride
/nvme/user/project/X-Decoder/xdecoder/modules/position_encoding.py:41: UserWarning: __floordiv__ is deprecated, and its behavior will change in a future version of pytorch. It currently rounds toward 0 (like the 'trunc' function NOT 'floor'). This results in incorrect rounding for negative values. To keep the current behavior, use torch.div(a, b, rounding_mode='trunc'), or for actual floor division, use torch.div(a, b, rounding_mode='floor').
  dim_t = self.temperature ** (2 * (dim_t // 2) / self.num_pos_feats)
/nvme/user/project/X-Decoder/xdecoder/architectures/xdecoder_model.py:899: UserWarning: __floordiv__ is deprecated, and its behavior will change in a future version of pytorch. It currently rounds toward 0 (like the 'trunc' function NOT 'floor'). This results in incorrect rounding for negative values. To keep the current behavior, use torch.div(a, b, rounding_mode='trunc'), or for actual floor division, use torch.div(a, b, rounding_mode='floor').
  topk_indices = (topk_indices // self.sem_seg_head.num_classes)
Traceback (most recent call last):
  File "/nvme/user/project/X-Decoder/entry.py", line 53, in <module>
    main()
  File "/nvme/user/project/X-Decoder/entry.py", line 48, in main
    trainer.eval()
  File "/nvme/user/project/X-Decoder/trainer/default_trainer.py", line 82, in eval
    results = self._eval_on_set(self.save_folder)
  File "/nvme/user/project/X-Decoder/trainer/default_trainer.py", line 87, in _eval_on_set
    results = self.pipeline.evaluate_model(self, save_folder)
  File "/nvme/user/project/X-Decoder/./pipeline/XDecoderPipeline.py", line 162, in evaluate_model
    self.evaluator.process(batch, outputs)
  File "/home/user/anaconda3/envs/xdecoder/lib/python3.9/site-packages/detectron2/evaluation/evaluator.py", line 88, in process
    evaluator.process(inputs, outputs)
  File "/nvme/user/project/X-Decoder/datasets/evaluation/segmentation_evaluation.py", line 113, in process
    (self._num_classes + 4) * pred.reshape(-1) + gt.reshape(-1),
ValueError: operands could not be broadcast together with shapes (272640,) (817920,) 
@MaureenZOU
Copy link
Collaborator

Interesting, I have never met with this bug before. Have you ever change any code, including batchsize/image size and etc.?

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