1

Getting cURL error: {"code":400,"error":"Cannot execute learning task. : no classifier name given"}

Getting the same result whether I use the beta GUI tool or a cURL entry:

curl -X POST \
-F "Airplanes_positive_examples=@Airplanes.zip" \
-F "Biking_positive_examples=@Biking.zip" \
-F "GolfPuttingGreens_positive_examples=@GolfPuttingGreens.zip" \
-F "name=AllJpegClassifier" \
"https://gateway-a.watsonplatform.net/visual-recognition/api/v3/classifiers?api_key={my-api-key}&version=2016-05-20"

I have read all previous SO questions for this problem and made sure of the following:

  • Classifier name is alphanumeric only
  • Zip filenames are alphanumeric only
  • Image filenames are alphanumeric with _ - . only
  • Zip files contain between 27 and 49 images each
  • All image files are the same format (JPEG)
  • All images conform to pixel size and file size limits
NickL
  • 11
  • 4

1 Answers1

1

Your command looks fine, and when I try it with my API key and my own zip files, it works. So I suspect there is something in your zip files that the system is having trouble with. If you could provide the "owner" guid field (also called you instance-id) I could look into our logs to try to diagnose it. This is displayed when you do a GET /classifiers/{cid} of an existing classifier. Alternatively, you could let me know one of your other existing classifier_ids

Another way would be if you could open a Bluemix support ticket and include copies of the zip files which you're using in this example. Then we can reproduce the problem.

Matt Hill
  • 1,081
  • 6
  • 4
  • Thanks Matt! I think I found the solution. I tried splitting the zips into 2 groups, ex: Airplanes1.zip and Airplanes2.zip. So the zips now contain between 14 and 26 images each. Now it seems to work. Is there a low max number of images per zip? – NickL Nov 02 '17 at 20:57
  • For training, using the POST /classifiers method like in your example, it should be fine to have >1000 images in a single zip file. I think that the process of rezipping when you split into 14 and 26 images must have changed whatever the problem was. You might try using the same zip app to combine the 14 and 26 back into a single zip and try that. By the way, for classification, (POST /classify) there is a limit on .zip file size of 20 images per zip. It will accept more but only process the first 20 and give a warning. – Matt Hill Nov 03 '17 at 00:39