Closed GallagherAiden closed 5 years ago
@SirSpidey ☝️
The example is now changed and reflects the latest version of the SDK
const fs = require('fs');
const VisualRecognitionV3 = require('watson-developer-cloud/visual-recognition/v3');
const visualRecognition = new VisualRecognitionV3({
version: '2018-03-19',
iam_apikey: '{apikey}',
});
const createClassifierParams = {
name: 'dogs',
negative_examples: fs.createReadStream('./cats.zip'),
positive_examples: {
beagle: fs.createReadStream('./beagle.zip'),
husky: fs.createReadStream('./husky.zip'),
goldenretriever: fs.createReadStream('./golden-retriever.zip'),
}
};
visualRecognition.createClassifier(createClassifierParams)
.then(classifier => {
console.log(JSON.stringify(classifier, null, 2));
})
.catch(err => {
console.log('error:', err);
});
I am following the example from here: https://cloud.ibm.com/apidocs/visual-recognition?code=node#create-a-classifier
With the following code:
Which gives the following error:
This fails on v4.0.1 but works on version 3.18.2 (albeit with warning)