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

raise KeyError(key) from None KeyError: 'config_file'

Open tcexeexe opened this issue 3 years ago • 1 comments

Hello~ l try to run the object-detector example,and l follow the instruction of https://github.com/heartexlabs/label-studio/blob/master/docs/source/tutorials/object-detector.md and download the checkpoint_file from MMDetection model zoo. l use the order to start the service label-studio-ml init coco-detector --from label_studio_ml/examples/mmdetection/mmdetection.py label-studio-ml start coco-detector --with config_file=./mmdetection/configs/faster_rcnn/faster_rcnn_r50_fpn_1x_coco.py checkpoint_file=/home/tcexeexe/dataDisk2/abel-studio-ml-backend/mmdetection/checkpoints/faster_rcnn_r50_fpn_1x_coco_20200130-047c8118.pth

My label setting is as follow 1650125205(1) but there is still an error occourred when l try to connect the label-studio-ml-backend 1650125340(1)

the error log from the backend is as follows:

[2022-04-17 00:29:16,909] [ERROR] [label_studio_ml.exceptions::exception_f::53] Traceback (most recent call last):
  File "/home/tcexeexe/dataDisk2/label-studio-ml-backend/label_studio_ml/exceptions.py", line 39, in exception_f
    return f(*args, **kwargs)
  File "/home/tcexeexe/dataDisk2/label-studio-ml-backend/label_studio_ml/api.py", line 50, in _setup
    model = _manager.fetch(project, schema, force_reload, hostname=hostname, access_token=access_token)
  File "/home/tcexeexe/dataDisk2/label-studio-ml-backend/label_studio_ml/model.py", line 502, in fetch
    model = cls.model_class(label_config=label_config, **kwargs)
  File "/home/tcexeexe/dataDisk2/label-studio-ml-backend/coco-detector/mmdetection.py", line 41, in __init__
    config_file = config_file or os.environ['config_file']
  File "/home/tcexeexe/anaconda3/envs/label_studio/lib/python3.8/os.py", line 675, in __getitem__
    raise KeyError(key) from None
KeyError: 'config_file'

Traceback (most recent call last):
  File "/home/tcexeexe/dataDisk2/label-studio-ml-backend/label_studio_ml/exceptions.py", line 39, in exception_f
    return f(*args, **kwargs)
  File "/home/tcexeexe/dataDisk2/label-studio-ml-backend/label_studio_ml/api.py", line 50, in _setup
    model = _manager.fetch(project, schema, force_reload, hostname=hostname, access_token=access_token)
  File "/home/tcexeexe/dataDisk2/label-studio-ml-backend/label_studio_ml/model.py", line 502, in fetch
    model = cls.model_class(label_config=label_config, **kwargs)
  File "/home/tcexeexe/dataDisk2/label-studio-ml-backend/coco-detector/mmdetection.py", line 41, in __init__
    config_file = config_file or os.environ['config_file']
  File "/home/tcexeexe/anaconda3/envs/label_studio/lib/python3.8/os.py", line 675, in __getitem__
    raise KeyError(key) from None
KeyError: 'config_file'

[2022-04-17 00:29:16,909] [INFO] [werkzeug::_log::225] 10.168.1.217 - - [17/Apr/2022 00:29:16] "POST /setup HTTP/1.1" 500 -

where the problem might be?

tcexeexe avatar Apr 16 '22 16:04 tcexeexe

Try to explicitly specify config_file as an environment variable:

config_file=/path/to/config/faster_rcnn_r50_fpn_1x.py label-studio-ml init coco-detector
config_file=/path/to/config/faster_rcnn_r50_fpn_1x.py label-studio-ml start coco-detector

makseq avatar Apr 19 '22 00:04 makseq

Close as unanswered or solved issue.

makseq avatar Mar 09 '23 18:03 makseq