hkchengrex / XMem

[ECCV 2022] XMem: Long-Term Video Object Segmentation with an Atkinson-Shiffrin Memory Model
https://hkchengrex.com/XMem/
MIT License
1.72k stars 191 forks source link

_lbfgsb.setulb(m, x, low_bnd, upper_bnd, nbd, f, g, factr, ValueError: failed in converting 7th argument `g' of _lbfgsb.setulb to C/Fortran array Aborted (core dumped) #104

Closed monajalal closed 10 months ago

monajalal commented 1 year ago

sometimes when I am trying to add or remove parts of the object of interest, I get this error:

traceback (most recent call last):
  File "/hdd/code/segmentation/XMem/inference/interact/gui.py", line 787, in on_mouse_release
    self.vis_map, self.vis_alpha = interaction.push_point(ex, ey,
  File "/hdd/code/segmentation/XMem/inference/interact/interaction.py", line 223, in push_point
    self.obj_mask = self.controller.interact(self.image.unsqueeze(0), x, y, not neg)
  File "/hdd/code/segmentation/XMem/inference/interact/fbrs_controller.py", line 43, in interact
    self.controller.add_click(x, y, is_positive)
  File "/hdd/code/segmentation/XMem/inference/interact/fbrs/controller.py", line 37, in add_click
    pred = self.predictor.get_prediction(self.clicker)
  File "/hdd/code/segmentation/XMem/inference/interact/fbrs/inference/predictors/base.py", line 42, in get_prediction
    pred_logits = self._get_prediction(image_nd, clicks_lists, is_image_changed)
  File "/hdd/code/segmentation/XMem/inference/interact/fbrs/inference/predictors/brs.py", line 107, in _get_prediction
    opt_result = fmin_l_bfgs_b(func=self.opt_functor, x0=self.opt_data,
  File "/home/mona/.local/lib/python3.10/site-packages/scipy/optimize/_lbfgsb_py.py", line 197, in fmin_l_bfgs_b
    res = _minimize_lbfgsb(fun, x0, args=args, jac=jac, bounds=bounds,
  File "/home/mona/.local/lib/python3.10/site-packages/scipy/optimize/_lbfgsb_py.py", line 350, in _minimize_lbfgsb
    _lbfgsb.setulb(m, x, low_bnd, upper_bnd, nbd, f, g, factr,
ValueError: failed in converting 7th argument `g' of _lbfgsb.setulb to C/Fortran array
Aborted (core dumped)
hkchengrex commented 1 year ago

Does this happen if you use f-BRS original code? By "sometimes", do you mean that there is no apparent pattern?

monajalal commented 1 year ago

if I do a bunch of left and right click specially if the object is a bit more complex and needs more clicks for creating the accurate-ish mask

hkchengrex commented 1 year ago

I cannot reproduce this problem. My best bet is to try f-BRS original code to narrow the problem down.