label-studio-ml-backend icon indicating copy to clipboard operation
label-studio-ml-backend copied to clipboard

NameError: name '_update_fn' is not defined when using the SAM

Open wingvortex opened this issue 1 year ago • 13 comments

Hi,

I installed the ml-backend according to the official steps: git clone https://github.com/HumanSignal/label-studio-ml-backend.git cd label-studio-ml-backend/ pip install -e .

Then I installed SAM and started label-studio-ml: pip install -r label_studio_ml/examples/segment_anything_model/requirements.txt label-studio-ml start label_studio_ml/examples/segment_anything_model

It resulted in a success that shows it was running on http://127.0.0.1:8080

But when I started the label studio, and config the SAM model: image

I get this error: label-studio-ml-backend/label_studio_ml/model.py", line 112, in fit if _update_fn: NameError: name '_update_fn' is not defined

Could you help with this issue?

wingvortex avatar Dec 14 '23 11:12 wingvortex

I understand the suggested approach is to install by Docker, but as I'm working with a Redhat linux, it needs sudo to run podman which I do not have. Anyway, the previous step seems very likely to work, the SAM is connected correctly: image But whenever I click the items in 'ML-Assisted Labeling' or 'Save' during the configuration of ML-backend, I would get the previous error in the terminal: image

And the SAM auto annotation could not give out any result as well.

wingvortex avatar Dec 15 '23 09:12 wingvortex

I've encountered the same issue. Have you managed to resolve it?

xiahaifeng1995 avatar Dec 18 '23 02:12 xiahaifeng1995

Not yet.

wingvortex avatar Dec 18 '23 08:12 wingvortex

Has anyone resolved this?

oltiMetdaan avatar Dec 20 '23 11:12 oltiMetdaan

same error

wonka80 avatar Dec 20 '23 13:12 wonka80

same error

song-GAO-1992 avatar Dec 21 '23 05:12 song-GAO-1992

收到您的邮件,谢谢!

wonka80 avatar Dec 21 '23 05:12 wonka80

Same error here.

Hope this will be resolved.

bcwein avatar Jan 10 '24 10:01 bcwein

收到您的邮件,谢谢!

wonka80 avatar Jan 10 '24 10:01 wonka80

Same error here, as well.

CLF3721 avatar Jan 28 '24 05:01 CLF3721

收到您的邮件,谢谢!

wonka80 avatar Jan 28 '24 05:01 wonka80

Same error when attempting to follow instructions for using tesseract backend.

korneliaWatson avatar Feb 09 '24 11:02 korneliaWatson

A workaround that worked for me is to add a dummy fit method to the SamMLBackend class in segment_anything_model/model.py

def fit(self, event, data, **additional_params):
    pass

goodfella47 avatar Feb 20 '24 20:02 goodfella47