label-studio-ml-backend
label-studio-ml-backend copied to clipboard
When trying to use SAM the model in my label studio show this error in the logs about the predictions
File "/usr/local/lib/python3.8/site-packages/label_studio_ml/model.py", line 617, in predict
server | predictions = cls._current_model.model.predict(tasks, **kwargs)
server | File "/app/segment_anything_model.py", line 69, in predict
server | height = kwargs['context']['result'][0]['original_height']
server | TypeError: 'NoneType' object is not subscriptable
my docker-compose
version: '3'
x-vision-common:
&vision-common
logging:
options:
max-size: "100m"
max-file: "5"
driver: json-file
services:
postgres:
<<: *vision-common
image: postgres:13.4-alpine
container_name: postgres
restart: always
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
volumes:
- ./volumes/postgres-data:/var/lib/postgresql/data
#----------------------------------------------------------------------------
# label Studio
#----------------------------------------------------------------------------
labelstudio:
<<: *vision-common
image: heartexlabs/label-studio:1.8.0
container_name: labelstudio
depends_on:
- postgres
environment:
DJANGO_DB: default
POSTGRE_NAME: ${POSTGRES_DB}
POSTGRE_USER: ${POSTGRES_USER}
POSTGRE_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRE_PORT: 5432
POSTGRE_HOST: postgres
LABEL_STUDIO_DISABLE_SIGNUP_WITHOUT_LINK: "false"
LABEL_STUDIO_PORT: 80
ports:
- 8080:80
#----------------------------------------------------------------------------
# redis
#----------------------------------------------------------------------------
redis:
image: redis:alpine
container_name: redis
hostname: redis
volumes:
- "./volumes/redis:/data"
expose:
- 6379
sam:
container_name: server
build: ./docker/segment_anything_model/
environment:
- MODEL_DIR=/data/models
- RQ_QUEUE_NAME=default
- REDIS_HOST=redis
- REDIS_PORT=6379
- LABEL_STUDIO_USE_REDIS=true
ports:
- 9090:9090
depends_on:
- redis
links:
- redis
volumes:
- "./volumes/sam/data/server:/data"
- "./volumes/sam/logs:/tmp"
I have the same problem
I have the same problem
Have you checked all of these settings?
https://github.com/heartexlabs/label-studio-ml-backend/pull/253#issuecomment-1640238453
Have you checked all of these settings?
step 1 Connect backend ML
step 2
Check webhook
Error
Traceback (most recent call last):
File "/home/user/.local/lib/python3.10/site-packages/label_studio_ml/exceptions.py", line 39, in exception_f
return f(*args, **kwargs)
File "/home/user/.local/lib/python3.10/site-packages/label_studio_ml/api.py", line 51, in _predict
predictions, model = _manager.predict(tasks, project, label_config, force_reload, try_fetch, **params)
File "/home/user/.local/lib/python3.10/site-packages/label_studio_ml/model.py", line 617, in predict
predictions = cls._current_model.model.predict(tasks, **kwargs)
File "/home/user/label-studio-ml-backend/my_ml_backend/segment_anything_model.py", line 69, in predict
height = kwargs['context']['result'][0]['original_height']
TypeError: 'NoneType' object is not subscriptable
Same problem
I think that is related to #4493
As indicated here, the first attempt that was unsuccessful, the program doesn't stop. I was able to use this backend correctly. Be sure to follow this step:
- Settings on the frontend as indicated on the readme
- Creating annotation as indicated on the readme
In particular, is necessary to select the BrushLabe and the KeyPointLabels before add a keypoint
Still having the same..
without changes error persisted
the individual setting is incomprehensible, maybe it decides something, but it is necessary that it would work in other conditions or describe exactly what each setting affects
Please watch this video for setup. If this doesn't help, please send a short clip showing you running the back end, what you do on the front end to receive predictions, and the terminal output on the back end.
Are you planning to fix this error or we forget about work together with SAM?
wait