沃森视觉识别:错误401 [英] Watson visual recognition: error 401

查看:112
本文介绍了沃森视觉识别:错误401的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用npm模块watson-developer-cloud进行视觉识别. 我得到{ error: 'invalid-api-key', code: 401 } 尝试运行以下代码时:

I'm trying npm module watson-developer-cloud for visual recognition. I'm getting { error: 'invalid-api-key', code: 401 } when trying to run following code:

var watson = require('watson-developer-cloud');
var fs = require('fs');

var visualRecognition = watson.visual_recognition({
 version: 'v3',
api_key: process.env.API_KEY || 'e2493f2bacdbea8becedcc7aafecdfb4133XXXXX',
 version_date: '2015-05-19'
 });

 var params = {
   images_file: fs.createReadStream('./resources/gopher.png')
 };

 visualRecognition.classify(params, function(err, res) {
  if (err)
 console.log(err);
 else
console.log(JSON.stringify(res, null, 2));
});

推荐答案

这与

This is the same problem raised in IBM Watson visual recognition - invalid API key. The Visual Recognition service was experiencing problems recognizing keys; the development team has resolved the issues as of July 14. (There is additional discussion of this issue on the IBM developerWorks Answers forum, and for issues with specific keys, you can open a Bluemix support ticket.

这篇关于沃森视觉识别:错误401的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆