Closed TitiHl closed 7 years ago
That error comes from the service itself, although a 406 status code and no actual error message seems odd. Can you post your code (minus the API Key) so I can try and replicate it?
Yep,
static train(classifier: string, trainFolder: string, positive_classIds: Array<string>) {
logger.debug(`Start sending data to Watson for training for classifier: ${classifier}`)
return new Promise(function(resolve, reject) {
let params = {
name: classifier
}
for (let entry of positive_classIds) {
let className = entry // where className are the classId that are digits like:
16c5c410369164acacaaf017da0e10d3
logger.debug(`${className} with ${trainFolder}/${entry}.zip`)
params[`${className}_positive_examples`] =
fs.createReadStream(`${trainFolder}/${entry}.zip`)
}
console.log(1, JSON.stringify(params))
visual_recognition.createClassifier(params,
function(err, response) {
if (err) {
logger.error(err)
reject(err)
} else {
let result = response
logger.debug(result)
resolve(result)
}
}
)
})
}
Also, when I lookup the failed case: curl -X GET "https://gateway-a.watsonplatform.net/visual-recognition/api/v3/classifiers/[Failed_classifier_id]?api_key=[myAPIKey]&version=2016-05-20"
it always return "explanation": "Cannot execute learning task. : Could not train classifier. Verify there are at least 10 positive training images for each class, and at least 10 other unique training images (inluding optional negative_examples). There is a minimum of 1 positive class." although the attached train data has more than 10 images for each zip.
Hiya, do you get any updates on this? it is affecting our product demo. Thanks, Alex
I suspect that this is an URP. I also suspect that there is a problem in your code, in which case this is not the right forum to continue this discussion. Please raise a question on https://developer.ibm.com/answers/topics/watson/ where we will try and debug your code.
In the process of that discussion if we do find that the root cause is the SDK or the Service, then we can come back to this issue on this repository.
Hey @TitiHl, I apologize, we're launching a new thing and are kind of underwater with last-minute preparations right now.
@chughts thanks! I'd appreciate it if you can get to the bottom of this.
Thanks all,
I have created an issue in https://developer.ibm.com/answers/topics/watson/ please have a look and advise.
Cheers, Alex
@TitiHl @germanattanasio is this still occurring?
Forum post is https://developer.ibm.com/answers/questions/379587/visual-recognition-node-sdk-throws-exception-when/
Error response was 406 - implying an accept header problem. Progress was halted due to the problem going away when the account was updated, not sure what effect that would have had. Unless a 406 was being raised when the account allocation was being exhausted as a result of the call, but that doesn't make sense.
I think it is ok to close this issue as it turns out a problem of API key.
Hi,
I am using watson-developer-cloud: 2.32.1 and trying to train a classifier like following with the attached zip files. it throws the following exception:
However, it works fine when I create the classifier via the tool UI:
http://visual-recognition-tooling.mybluemix.net/ 16c5c410369164acacaaf017da0e10d3.zip 16c5c410369164acacaaf017da0e5443.zip