Closed sanjeevghimire closed 6 years ago
if i don't pass the url above i get this error:
"2018-09-25T16:37:26.250051212Z stdout: Downloading image..."
--
3 | "2018-09-25T16:37:26.769502112Z stdout: Saving image locally ..."
4 | "2018-09-25T16:37:26.769821947Z stdout: Checking image for explicit content...https://files.slack.com/files-pri/T4CHDRF36-FD0JHM9D1/explicit.jpg"
6 | "2018-09-25T16:37:27.088759172Z stderr: Traceback (most recent call last):"
7 | "2018-09-25T16:37:27.088793662Z stderr: File \"pythonrunner.py\", line 88, in run"
8 | "2018-09-25T16:37:27.088799045Z stderr: exec('fun = %s(param)' % self.mainFn, self.global_context)"
9 | "2018-09-25T16:37:27.088803428Z stderr: File \"<string>\", line 1, in <module>"
10 | "2018-09-25T16:37:27.088808468Z stderr: File \"__main__.py\", line 49, in main"
11 | "2018-09-25T16:37:27.088812967Z stderr: File \"/usr/local/lib/python3.6/site-packages/watson_developer_cloud/visual_recognition_v3.py\", line 169, in classify"
12 | "2018-09-25T16:37:27.088817319Z stderr: accept_json=True)"
13 | "2018-09-25T16:37:27.088821309Z stderr: File \"/usr/local/lib/python3.6/site-packages/watson_developer_cloud/watson_service.py\", line 468, in request"
14 | "2018-09-25T16:37:27.088825473Z stderr: info=error_info, httpResponse=response)"
15 | "2018-09-25T16:37:27.088829646Z stderr: watson_developer_cloud.watson_service.WatsonApiException: Error: Unknown error, Code: 400 , X-dp-watson-tran-id: gateway02-524559655 , X-global-transaction-id: ffea405d5baa64461f442527"
The API url is url='https://gateway.watsonplatform.net/visual-recognition/api'
@ehdsouza the url is optional right? I get 400 errorif I don’t pass url
Are you using a cloud foundry
or resource controller
instance?
@ehdsouza I am using IBM Cloud Functions
and using the watson developer cloud SDK provided.
The url depends on which region your visual recognition instance is in. Do check in the service dashboard: https://console.bluemix.net/dashboard/apps/
for the url of your service instance
Expected behavior
should create the instance without failing
Actual behavior
Steps to reproduce the problem
create the instance part of IBM Cloud function and upload it. I am using the SDK part of the IBM cloud function runtime using: I created the function using:
Code snippet (Note: Do not paste your credentials)
visual_recognition = VisualRecognitionV3( '2016-05-20', iam_url='https://gateway.watsonplatform.net/visual-recognition/api', iam_api_key=''
)
python sdk version
1.7.0 - which is the one in IBM Cloud Function runtime
python version
3.6