dbolya/tide

ValueError: negative dimensions are not allowed

hyperparameters opened this issue · 0 comments

Facing this error

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-7-4f5ad051ad2b> in <module>()
      9 tide.evaluate(datasets.COCO(gt_path), datasets.COCOResult(det_path), mode=TIDE.BOX) # Use TIDE.MASK for masks
     10 tide.summarize()  # Summarize the results as tables in the console
---> 11 tide.plot()

/opt/conda/lib/python3.6/site-packages/tidecv/quantify.py in plot(self, out_dir)
    566 
    567                 for run_name, run in self.runs.items():
--> 568                         self.plotter.make_summary_plot(out_dir, errors, run_name, run.mode, hbar_names=True)
    569 
    570 

/opt/conda/lib/python3.6/site-packages/tidecv/plotting.py in make_summary_plot(self, out_dir, errors, model_name, rec_type, hbar_names)
    180                 lpad, rpad = int(np.ceil((pie_im.shape[1] - summary_im.shape[1])/2)), \
    181                                         int(np.floor((pie_im.shape[1] - summary_im.shape[1])/2))
--> 182 		summary_im = np.concatenate([np.zeros((summary_im.shape[0], lpad, 3)) + 255,
    183                                                                         summary_im,
    184 									np.zeros((summary_im.shape[0], rpad, 3)) + 255], axis=1)

ValueError: negative dimensions are not allowed

Attached pdb and got that lpad is negative

import pdb; pdb.pm()

> /opt/conda/lib/python3.6/site-packages/tidecv/plotting.py(182)make_summary_plot()
-> summary_im = np.concatenate([np.zeros((summary_im.shape[0], lpad, 3)) + 255,
(Pdb)  lpad
-30

Solution

  • check the width of pie_im and summary_im.
  • pad the one with small width