HumanSignal / HumanSignal/label-studio-ml-backend

parsed_label_config: TypeError: the JSON object must be str, bytes or bytearray, not NoneType

Open
#343 4 comments 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
1.1k
Forks
490
Avg merge
1d 14h
Merged PRs (30d)
3

Description

[2023-08-30 19:05:45,482] [INFO] [werkzeug::_log::187] 10.27.86.50 - - [30/Aug/2023 19:05:45] "GET /health HTTP/1.1" 200 -
nabil
[2023-08-30 19:05:45,667] [ERROR] [label_studio_ml.exceptions::exception_f::53] Traceback (most recent call last):
File "/Users/nr83/git/label-studio-ml-backend/label_studio_ml/exceptions.py", line 39, in exception_f
return f(*args, **kwargs)
File "/Users/nr83/git/label-studio-ml-backend/label_studio_ml/api.py", line 71, in _setup
model = MODEL_CLASS(project_id)
File "/Users/nr83/git/label-studio-ml-backend/my_ml_backend/pytorch_transfer_learning.py", line 159, in __init__
print( self.parsed_label_config)
File "/Users/nr83/git/label-studio-ml-backend/label_studio_ml/model.py", line 64, in parsed_label_config
return json.loads(self.get('parsed_label_config'))
File "/Users/nr83/anaconda3/envs/label_studio/lib/python3.10/json/__init__.py", line 339, in loads
raise TypeError(f'the JSON object must be str, bytes or bytearray, '
TypeError: the JSON object must be str, bytes or bytearray, not NoneType

Traceback (most recent call last):
File "/Users/nr83/git/label-studio-ml-backend/label_studio_ml/exceptions.py", line 39, in exception_f
return f(*args, **kwargs)
File "/Users/nr83/git/label-studio-ml-backend/label_studio_ml/api.py", line 71, in _setup
model = MODEL_CLASS(project_id)
File "/Users/nr83/git/label-studio-ml-backend/my_ml_backend/pytorch_transfer_learning.py", line 159, in __init__
print( self.parsed_label_config)
File "/Users/nr83/git/label-studio-ml-backend/label_studio_ml/model.py", line 64, in parsed_label_config
return json.loads(self.get('parsed_label_config'))
File "/Users/nr83/anaconda3/envs/label_studio/lib/python3.10/json/__init__.py", line 339, in loads
raise TypeError(f'the JSON object must be str, bytes or bytearray, '
TypeError: the JSON object must be str, bytes or bytearray, not NoneType

[2023-08-30 19:05:45,667] [INFO] [werkzeug::_log::187] 10.27.86.50 - - [30/Aug/2023 19:05:45] "POST /setup HTTP/1.1" 500 -

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with label_studio_ml/model.py at parsed_label_config and follow how label_studio_ml/api.py calls MODEL_CLASS during POST /setup. Reproduce the setup failure with a missing parsed_label_config value and trace the expected handling; done means setup no longer raises the shown TypeError in that case.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend, machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.