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

ValueError: Input must be 1- or 2-d. #79

Open
hahahaff opened this issue Apr 18, 2024 · 1 comment
Open

ValueError: Input must be 1- or 2-d. #79

hahahaff opened this issue Apr 18, 2024 · 1 comment

Comments

@hahahaff
Copy link

When training, the following error occurred.
I did not know how to solve it. Could anyone provide some ideas to solve?Thanks a lot!
12284cad9bed6c0b537c29c7493739d
27fe8ae389e79acfeda519b83d0b62f

  File "/home/auto/anaconda3/envs/2Dpass/lib/python3.8/site-packages/pytorch_lightning/loops/loop.py", line 206, in run
    output = self.on_run_end()
  File "/home/auto/anaconda3/envs/2Dpass/lib/python3.8/site-packages/pytorch_lightning/loops/dataloader/evaluation_loop.py", line 180, in on_run_end
    self._evaluation_epoch_end(self._outputs)
  File "/home/auto/anaconda3/envs/2Dpass/lib/python3.8/site-packages/pytorch_lightning/loops/dataloader/evaluation_loop.py", line 288, in _evaluation_epoch_end
    self.trainer._call_lightning_module_hook(hook_name, output_or_outputs)
  File "/home/auto/anaconda3/envs/2Dpass/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 1347, in _call_lightning_module_hook
    output = fn(*args, **kwargs)
  File "/media/auto/data/lff_projection/2DPASS-main/network/base_model.py", line 226, in validation_epoch_end
    iou, best_miou = self.val_iou.compute()
  File "/home/auto/anaconda3/envs/2Dpass/lib/python3.8/site-packages/torchmetrics/metric.py", line 440, in wrapped_func
    value = compute(*args, **kwargs)
  File "/media/auto/data/lff_projection/2DPASS-main/utils/metric_util.py", line 38, in compute
    iou = per_class_iu(sum(self.hist_list))
  File "/media/auto/data/lff_projection/2DPASS-main/utils/metric_util.py", line 15, in per_class_iu
    return np.diag(hist) / (hist.sum(1) + hist.sum(0) - np.diag(hist))
  File "<__array_function__ internals>", line 5, in diag
  File "/home/auto/anaconda3/envs/2Dpass/lib/python3.8/site-packages/numpy/lib/twodim_base.py", line 303, in diag
    raise ValueError("Input must be 1- or 2-d.")
ValueError: Input must be 1- or 2-d.
@issouker97
Copy link

Hey, would you please tell me how could you finally achieve to train your 2DPASS and what is the dataset that you use for it !
can you tell also if you know how to train 2DPASS with another dataset ( in my case, i wanna train it on mine dataset)

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