Open themantalope opened 2 years ago
Hi @themantalope Could you please tell me your label-studio-ml-backend version?
@KonstantinKorotaev
Thanks for getting back to me. I'm using the current version, installed via pip install git+https://github.com/heartexlabs/label-studio-ml-backend
. The current version used is 1.0.7
.
I should also clarify. When using the curl
command in step 8, I also do not get any response from the server.
Do you have any logs from Label Studio and from ML backend?
@KonstantinKorotaev
Here are the logs after clicking the "Start Training" button 3 times.
Congratulations! ML Backend has been successfully initialized in ./modeling_backend
Now start it by using:
label-studio-ml start ./modeling_backend
* Serving Flask app "label_studio_ml.api" (lazy loading)
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: on
[2022-06-29 01:54:08,277] [WARNING] [werkzeug::_log::225] * Running on all addresses.
WARNING: This is a development server. Do not use it in a production deployment.
[2022-06-29 01:54:08,277] [INFO] [werkzeug::_log::225] * Running on http://192.168.128.2:9090/ (Press CTRL+C to quit)
[2022-06-29 01:54:08,278] [INFO] [werkzeug::_log::225] * Restarting with stat
[2022-06-29 01:54:09,476] [WARNING] [werkzeug::_log::225] * Debugger is active!
[2022-06-29 01:54:09,477] [INFO] [werkzeug::_log::225] * Debugger PIN: 133-986-258
Congratulations! ML Backend has been successfully initialized in ./modeling_backend
Now start it by using:
label-studio-ml start ./modeling_backend
* Serving Flask app "label_studio_ml.api" (lazy loading)
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: on
[2022-06-29 15:00:29,793] [WARNING] [werkzeug::_log::225] * Running on all addresses.
WARNING: This is a development server. Do not use it in a production deployment.
[2022-06-29 15:00:29,794] [INFO] [werkzeug::_log::225] * Running on http://192.168.128.2:9090/ (Press CTRL+C to quit)
[2022-06-29 15:00:29,795] [INFO] [werkzeug::_log::225] * Restarting with stat
[2022-06-29 15:00:31,030] [WARNING] [werkzeug::_log::225] * Debugger is active!
[2022-06-29 15:00:31,032] [INFO] [werkzeug::_log::225] * Debugger PIN: 206-914-877
[2022-06-29 15:17:58,455] [INFO] [werkzeug::_log::225] 192.168.128.3 - - [29/Jun/2022 15:17:58] "GET /health HTTP/1.1" 200 -
parsed label config:
{'label': {'type': 'RectangleLabels', 'to_name': ['image'], 'inputs': [{'type': 'Image', 'value': 'image'}], 'labels': ['text'], 'labels_attrs': {'text': {'value': 'text', 'background': '#FFA39E'}}}}
[2022-06-29 15:17:59,751] [INFO] [werkzeug::_log::225] 192.168.128.3 - - [29/Jun/2022 15:17:59] "POST /setup HTTP/1.1" 200 -
[2022-06-29 15:18:09,622] [INFO] [werkzeug::_log::225] 192.168.128.3 - - [29/Jun/2022 15:18:09] "GET /health HTTP/1.1" 200 -
[2022-06-29 15:18:09,652] [INFO] [werkzeug::_log::225] 192.168.128.3 - - [29/Jun/2022 15:18:09] "POST /setup HTTP/1.1" 200 -
[2022-06-29 15:18:09,721] [INFO] [werkzeug::_log::225] 192.168.128.3 - - [29/Jun/2022 15:18:09] "GET /health HTTP/1.1" 200 -
[2022-06-29 15:18:09,731] [INFO] [werkzeug::_log::225] 192.168.128.3 - - [29/Jun/2022 15:18:09] "POST /setup HTTP/1.1" 200 -
[2022-06-29 15:18:09,805] [INFO] [werkzeug::_log::225] 192.168.128.3 - - [29/Jun/2022 15:18:09] "GET /health HTTP/1.1" 200 -
[2022-06-29 15:18:09,822] [INFO] [werkzeug::_log::225] 192.168.128.3 - - [29/Jun/2022 15:18:09] "POST /setup HTTP/1.1" 200 -
[2022-06-29 15:18:09,907] [INFO] [werkzeug::_log::225] 192.168.128.3 - - [29/Jun/2022 15:18:09] "GET /health HTTP/1.1" 200 -
[2022-06-29 15:18:09,916] [INFO] [werkzeug::_log::225] 192.168.128.3 - - [29/Jun/2022 15:18:09] "POST /setup HTTP/1.1" 200 -
[2022-06-29 15:18:09,980] [INFO] [werkzeug::_log::225] 192.168.128.3 - - [29/Jun/2022 15:18:09] "GET /health HTTP/1.1" 200 -
[2022-06-29 15:18:09,987] [INFO] [werkzeug::_log::225] 192.168.128.3 - - [29/Jun/2022 15:18:09] "POST /setup HTTP/1.1" 200 -
[2022-06-29 15:18:21,867] [INFO] [werkzeug::_log::225] 192.168.128.3 - - [29/Jun/2022 15:18:21] "POST /webhook HTTP/1.1" 201 -
[2022-06-29 15:18:21,895] [INFO] [werkzeug::_log::225] 192.168.128.3 - - [29/Jun/2022 15:18:21] "GET /health HTTP/1.1" 200 -
[2022-06-29 15:18:21,903] [INFO] [werkzeug::_log::225] 192.168.128.3 - - [29/Jun/2022 15:18:21] "POST /setup HTTP/1.1" 200 -
[2022-06-29 15:18:23,139] [ERROR] [label_studio_ml.model::get_result::58]
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/label_studio_ml/model.py", line 56, in get_result
job_result = self.get_result_from_job_id(model_version)
File "/usr/local/lib/python3.8/site-packages/label_studio_ml/model.py", line 110, in get_result_from_job_id
assert isinstance(result, dict)
AssertionError
parsed label config:
{'label': {'type': 'RectangleLabels', 'to_name': ['image'], 'inputs': [{'type': 'Image', 'value': 'image'}], 'labels': ['text'], 'labels_attrs': {'text': {'value': 'text', 'background': '#FFA39E'}}}}
now running the fit function....
tasks: ()
image urls: []
image classes: []
[2022-06-29 15:18:36,306] [INFO] [werkzeug::_log::225] 192.168.128.3 - - [29/Jun/2022 15:18:36] "POST /webhook HTTP/1.1" 201 -
[2022-06-29 15:18:36,335] [INFO] [werkzeug::_log::225] 192.168.128.3 - - [29/Jun/2022 15:18:36] "GET /health HTTP/1.1" 200 -
[2022-06-29 15:18:36,342] [INFO] [werkzeug::_log::225] 192.168.128.3 - - [29/Jun/2022 15:18:36] "POST /setup HTTP/1.1" 200 -
[2022-06-29 15:18:37,494] [ERROR] [label_studio_ml.model::get_result::58]
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/label_studio_ml/model.py", line 56, in get_result
job_result = self.get_result_from_job_id(model_version)
File "/usr/local/lib/python3.8/site-packages/label_studio_ml/model.py", line 110, in get_result_from_job_id
assert isinstance(result, dict)
AssertionError
parsed label config:
{'label': {'type': 'RectangleLabels', 'to_name': ['image'], 'inputs': [{'type': 'Image', 'value': 'image'}], 'labels': ['text'], 'labels_attrs': {'text': {'value': 'text', 'background': '#FFA39E'}}}}
now running the fit function....
tasks: ()
image urls: []
image classes: []
Sorry about that! I saw the error but forgot to include it in the initial description of the issue.
Also, looks like the fit
function is actually getting triggered but it's not getting any tasks...
This could be due to the way I've set up the label-studio
and label-studio-ml
containers. I'm running all of them from a single docker-compose.yml
file (specified in the problem description). When I restart the stack using docker-compose down; docker-compose up --build
, the logs for the modeling_container
are now showing a different output after clicking the "Start Training" button:
Congratulations! ML Backend has been successfully initialized in ./modeling_backend
Now start it by using:
label-studio-ml start ./modeling_backend
* Serving Flask app "label_studio_ml.api" (lazy loading)
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: on
[2022-06-29 15:32:33,354] [WARNING] [werkzeug::_log::225] * Running on all addresses.
WARNING: This is a development server. Do not use it in a production deployment.
[2022-06-29 15:32:33,355] [INFO] [werkzeug::_log::225] * Running on http://172.19.0.3:9090/ (Press CTRL+C to quit)
[2022-06-29 15:32:33,355] [INFO] [werkzeug::_log::225] * Restarting with stat
[2022-06-29 15:32:34,563] [WARNING] [werkzeug::_log::225] * Debugger is active!
[2022-06-29 15:32:34,564] [INFO] [werkzeug::_log::225] * Debugger PIN: 941-357-599
[2022-06-29 15:32:50,161] [INFO] [werkzeug::_log::225] 172.19.0.4 - - [29/Jun/2022 15:32:50] "GET /health HTTP/1.1" 200 -
parsed label config:
{'label': {'type': 'RectangleLabels', 'to_name': ['image'], 'inputs': [{'type': 'Image', 'value': 'image'}], 'labels': ['text'], 'labels_attrs': {'text': {'value': 'text', 'background': '#FFA39E'}}}}
config.yaml?dl=1: 0.00B [00:00, ?B/s]
config.yaml?dl=1: 8.19kB [00:01, 5.55kB/s]
config.yaml?dl=1: 8.19kB [00:01, 5.54kB/s]
[2022-06-29 15:32:53,543] [INFO] [werkzeug::_log::225] 172.19.0.4 - - [29/Jun/2022 15:32:53] "GET /health HTTP/1.1" 200 -
parsed label config:
{'label': {'type': 'RectangleLabels', 'to_name': ['image'], 'inputs': [{'type': 'Image', 'value': 'image'}], 'labels': ['text'], 'labels_attrs': {'text': {'value': 'text', 'background': '#FFA39E'}}}}
[2022-06-29 15:32:59,047] [INFO] [werkzeug::_log::225] 172.19.0.4 - - [29/Jun/2022 15:32:59] "POST /setup HTTP/1.1" 200 -
[2022-06-29 15:32:59,595] [INFO] [werkzeug::_log::225] 172.19.0.4 - - [29/Jun/2022 15:32:59] "POST /setup HTTP/1.1" 200 -
[2022-06-29 15:33:55,655] [INFO] [werkzeug::_log::225] 172.19.0.4 - - [29/Jun/2022 15:33:55] "GET /health HTTP/1.1" 200 -
[2022-06-29 15:33:55,664] [INFO] [werkzeug::_log::225] 172.19.0.4 - - [29/Jun/2022 15:33:55] "POST /setup HTTP/1.1" 200 -
[2022-06-29 15:33:55,681] [INFO] [werkzeug::_log::225] 172.19.0.4 - - [29/Jun/2022 15:33:55] "GET /health HTTP/1.1" 200 -
[2022-06-29 15:33:55,689] [INFO] [werkzeug::_log::225] 172.19.0.4 - - [29/Jun/2022 15:33:55] "POST /setup HTTP/1.1" 200 -
[2022-06-29 15:33:55,697] [INFO] [werkzeug::_log::225] 172.19.0.4 - - [29/Jun/2022 15:33:55] "GET /health HTTP/1.1" 200 -
[2022-06-29 15:33:55,702] [INFO] [werkzeug::_log::225] 172.19.0.4 - - [29/Jun/2022 15:33:55] "POST /setup HTTP/1.1" 200 -
[2022-06-29 15:33:55,735] [INFO] [werkzeug::_log::225] 172.19.0.4 - - [29/Jun/2022 15:33:55] "GET /health HTTP/1.1" 200 -
[2022-06-29 15:33:55,747] [INFO] [werkzeug::_log::225] 172.19.0.4 - - [29/Jun/2022 15:33:55] "POST /setup HTTP/1.1" 200 -
[2022-06-29 15:33:58,813] [INFO] [werkzeug::_log::225] 172.19.0.4 - - [29/Jun/2022 15:33:58] "POST /webhook HTTP/1.1" 201 -
[2022-06-29 15:33:58,843] [INFO] [werkzeug::_log::225] 172.19.0.4 - - [29/Jun/2022 15:33:58] "GET /health HTTP/1.1" 200 -
[2022-06-29 15:33:58,853] [INFO] [werkzeug::_log::225] 172.19.0.4 - - [29/Jun/2022 15:33:58] "POST /setup HTTP/1.1" 200 -
[2022-06-29 15:34:19,886] [INFO] [werkzeug::_log::225] 172.19.0.4 - - [29/Jun/2022 15:34:19] "POST /webhook HTTP/1.1" 201 -
[2022-06-29 15:34:19,911] [INFO] [werkzeug::_log::225] 172.19.0.4 - - [29/Jun/2022 15:34:19] "GET /health HTTP/1.1" 200 -
[2022-06-29 15:34:19,920] [INFO] [werkzeug::_log::225] 172.19.0.4 - - [29/Jun/2022 15:34:19] "POST /setup HTTP/1.1" 200 -
[2022-06-29 15:34:22,335] [INFO] [werkzeug::_log::225] 172.19.0.4 - - [29/Jun/2022 15:34:22] "POST /webhook HTTP/1.1" 201 -
[2022-06-29 15:34:22,361] [INFO] [werkzeug::_log::225] 172.19.0.4 - - [29/Jun/2022 15:34:22] "GET /health HTTP/1.1" 200 -
[2022-06-29 15:34:22,372] [INFO] [werkzeug::_log::225] 172.19.0.4 - - [29/Jun/2022 15:34:22] "POST /setup HTTP/1.1" 200 -
EDIT:
The logs here do not show the fit
function getting triggered. I wonder if this is because of label-studio-ml
using it's own docker-compose
network?
The logs here do not show the fit function getting triggered. I wonder if this is because of label-studio-ml using it's own docker-compose network?
The log has webhook calls, please check this guide.
Also, looks like the fit function is actually getting triggered but it's not getting any tasks...
Check the guide about training with webhooks. Here is the example how you can get annotated dataset.
@KonstantinKorotaev
Thank you for the clarification. A webhook is also called when the user submits a POST
to the api/ml/{id}/train
endpoint. Is there a way to modify the webhook that is triggered when the user clicks the "Start Training" button, or if the submit a POST
request to the api/ml/{id}/train
endpoint? The options in the label studio webhook editing page are limited to events related to the creation/update/delete of tasks, annotations etc.
Is there a way to modify the webhook that is triggered when the user clicks the "Start Training" button, or if the submit a POST request to the api/ml/{id}/train endpoint?
What do you want to add there?
Describe the bug Per the documentation, it seems that the
api/ml/{id}/train
should trigger the training process on the ML backend, which should trigger thefit
function of theLabelStudioMLBase
model. However, when running this command, even viacurl
there is no response from thelabel-studio
server nor does thefit
method get triggered.Here is the current version of the
docker-compose.yml
file for my project:Here is my
model.py
file for the ML backend.Right now, there isn't much in the
fit
function, I just wanted to make sure it was working however nothing gets printed to the logs of themodeling_container
.To Reproduce Steps to reproduce the behavior:
http://localhost:8080
http://modeling_container:9090
since all containers are on the same docker-compose network.predict
function specified inmodel.py
Settings->Machine Learning
and clickStart Training
on the connected ML backendcurl -X POST http://localhost:8080/api/ml/{id}/train -H 'Authorization: Token <token>'
also does nothing.Expected behavior Code in the
fit
function should trigger when the curl command is launched or "Start Training" button is clicked.Screenshots Can provide if needed.
Environment (please complete the following information):
Additional context It's entirely possible that I'm not configuring the project correctly, so please let me know.