label-studio: Tutorial pytorch-image-transfer-learning does not work

First of all, thank you for all your great work! I have a current installation of Label-Studio on Ubuntu 20.04. Wanting to classify images, I have followed the tutorial at https://labelstud.io/tutorials/pytorch-image-transfer-learning.html and got to the point where I could run the service and connect to Label-Studio, well sort of. However, it seems I am overlooking something in the last section ImageClassifierAPI. On trying to connect, the connection itself is established but I get

[](http://slack.labelstud.io.s3-website-us-east-1.amazonaws.com/?source=product-error-msg)Validation error
Successfully connected to http://192.168.178.68:9090/ but it doesn't look like a valid ML backend. Reason: 500 Server Error: INTERNAL SERVER ERROR for url: http://192.168.178.68:9090/setup.
Check the ML backend server console logs to check the status. There might be
something wrong with your model or it might be incompatible with the current labeling configuration.
Version: 1.4

in Label-Studio. From the service terminal I get

File "/~/label-studio/label-studio-ml-image-backend/image_label_backend/model.py", line 113, in __init__
    self.model = ImageClassifier(resources['num_classes'])
NameError: name 'resources' is not defined

I have read in the tutorial that I need to overwrite something but then again - how? Looked like this was a working example. resources ist indeed not defined. How do I need to define this? Do I need to fetch attributes like super(ImageClassifierAPI, self).__init__(**kwargs) and using the attributes described here: https://pypi.org/project/label-studio-ml/ ?

Any help is highly appreciated. Thank you very much.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 16 (6 by maintainers)

Most upvoted comments

@greyeagle Thank you for your kind words!

Could you check the ML backend from this branch - https://github.com/heartexlabs/label-studio-ml-backend/pull/72 ? Also I would recommend to use label-studio==1.4.1rc3 (or LS master branch).