When I try to train a classifier with two positive classes and with the API key (each class contains around 1200 images) in Watson Visual Recognition, it returns that "no classifier name is given" - but that I have already provided. This is the code:
$ curl -X POST -F "blank_positive_examples=@C:\Users\rahansen\Desktop\Altmuligt\training\no_ocd\no_ocd.zip" -F "OCD_positive_examples=@C:\Users\rahansen\Desktop\Altmuligt\training\ocd\ocd.zip" -F "name=disease" "https://gateway-a.watsonplatform.net/visual-recognition/api/v3/classifiers?api_key={X}&version=2016-05-20"
{"code":400,"error":"Cannot execute learning task. : no classifier name given"}
What I have done so far:
- Removed all special characters in the file names as I thought that might be the problem:
- Tried to give other names for the classifeir, e.g. "name=ocd"
- I also tried to train it on a smaller dataset, like 40 images in each positive class and then it actually works fine. So maybe the size of the dataset is the problem. However, according to Watson training guidelines, I comply with the size regulations: https://www.ibm.com/watson/developercloud/doc/visual-recognition/customizing.html I have a free subscription.
Do anyone has any recommendations for how to solve this classifier training problem?
This can occur when there's a problem processing the zip files. I would try simplifying your training files. For instance, use just 100 examples for class, then you can add more via retraining later. It's always good to train then measure performance and then add more training samples.
@Rasmus, you should verify the name their picture neatly, meaning no special symbols, spaces or etc. in the file name of images. It appears to be related to special characters in the input. This API expects only characters and numbers in the alphabet as classifier names. It also requires that the images in your zip files end with a file extension for images like
.jpg
,.jpeg
,.gif
or.png
So, after you rename the images, check if all have the correct formats, like
.jpg
,.png
, and supported formats for Visual Recognition.Replace
{api-key}
with the service credentials you copied in the first step. Modify the location of the{class}_positive_examples
to point to where you saved the .zip files.And, use your
cURL
like:Obs. Can be other problem, see Other ask about error with classifier name.
My example working in my PC computer:
See the official reference here.