hkchengrex/Cutie

Get error when doing 7th left-click for foreground annotation

Opened this issue · 2 comments

Traceback (most recent call last):
File "/home/tianyaozhang/Cutie/gui/gui.py", line 451, in on_mouse_press
self.click_fn(action, ex, ey)
File "/home/tianyaozhang/Cutie/gui/main_controller.py", line 170, in click_fn
self.interaction.push_point(x, y, is_neg=(action == 'right'))
File "/home/tianyaozhang/Cutie/gui/interaction.py", line 83, in push_point
self.obj_mask = self.controller.interact(self.image.unsqueeze(0),
File "/home/tianyaozhang/Cutie/gui/click_controller.py", line 50, in interact
self.controller.add_click(x, y, is_positive, prev_mask=prev_mask)
File "/home/tianyaozhang/Cutie/gui/ritm/controller.py", line 42, in add_click
pred = self.predictor.get_prediction(self.clicker, prev_mask=prev_mask)
File "/home/tianyaozhang/Cutie/gui/ritm/inference/predictors/base.py", line 66, in get_prediction
pred_logits = self._get_prediction(image_nd, clicks_lists, is_image_changed)
File "/home/tianyaozhang/Cutie/gui/ritm/inference/predictors/brs.py", line 214, in _get_prediction
opt_result = fmin_l_bfgs_b(func=self.opt_functor,
File "/home/tianyaozhang/anaconda3/envs/seg/lib/python3.8/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/tianyaozhang/anaconda3/envs/seg/lib/python3.8/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

Reference: hkchengrex/XMem#104
I have not been able to reproduce this issue. This may be related to the environment setup -- perhaps re-installing the relevant packages can help. I believe it is happening internally in fbrs/ritm, meaning there is very little that we can do in this repository.

Traceback (most recent call last): File "/home/tianyaozhang/Cutie/gui/gui.py", line 451, in on_mouse_press self.click_fn(action, ex, ey) File "/home/tianyaozhang/Cutie/gui/main_controller.py", line 170, in click_fn self.interaction.push_point(x, y, is_neg=(action == 'right')) File "/home/tianyaozhang/Cutie/gui/interaction.py", line 83, in push_point self.obj_mask = self.controller.interact(self.image.unsqueeze(0), File "/home/tianyaozhang/Cutie/gui/click_controller.py", line 50, in interact self.controller.add_click(x, y, is_positive, prev_mask=prev_mask) File "/home/tianyaozhang/Cutie/gui/ritm/controller.py", line 42, in add_click pred = self.predictor.get_prediction(self.clicker, prev_mask=prev_mask) File "/home/tianyaozhang/Cutie/gui/ritm/inference/predictors/base.py", line 66, in get_prediction pred_logits = self._get_prediction(image_nd, clicks_lists, is_image_changed) File "/home/tianyaozhang/Cutie/gui/ritm/inference/predictors/brs.py", line 214, in _get_prediction opt_result = fmin_l_bfgs_b(func=self.opt_functor, File "/home/tianyaozhang/anaconda3/envs/seg/lib/python3.8/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/tianyaozhang/anaconda3/envs/seg/lib/python3.8/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

Hey, friend. I finally work it out. I encounter this error before, then I reconstruct the environment by conda create -n cutie python=3.9 &&conda activate cutie && conda install pytorch=2.1 torchvision -c pytorch && conda install -e . without other complex command. This works for me, I hope this can help you. Make sure that python=3.9 and numpy version<2.0 &&>=1.23.0
1722841035785