Why is there an error “invalid data input” when I try to test a successfully deployed ML model?

Alice

I followed a sample notebook to create a IBM cloud machine learning model using scikit-learn. The tutorial can be found here.

Every cell runs correctly and the model is deployed successfully, but when I click into the model and try to make a prediction, an error “Invalid input data” shows up. Why does this issue occur and how should I solve this?

enter image description here

wml_credentials = {
  "username": "****",
  "password": "****",
  "instance_id": "****",
  "url": "https://ibm-watson-ml.mybluemix.net”
}

When creating the API client, I tried changing the url from "https://ibm-watson-ml.mybluemix.net” to "https://us-south.ml.cloud.ibm.com”.

I also tried adding the access key like:

wml_credentials = {
  "access_key”: "****",
  "username": "****",
  "password": "****",
  "instance_id": "****",
  "url": "https://ibm-watson-ml.mybluemix.net”
}

Nothing helped.

Vidyasagar Machupalli

Instead of passing individual values for f0,f1,f2..... You can pass the input as JSON shown below

{
  "fields" : [ "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23", "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31", "f32", "f33", "f34", "f35", "f36", "f37", "f38", "f39", "f40", "f41", "f42", "f43", "f44", "f45", "f46", "f47", "f48", "f49", "f50", "f51", "f52", "f53", "f54", "f55", "f56", "f57", "f58", "f59", "f60", "f61", "f62", "f63" ],
  "values" : [ [ 0.0, 5.0, 12.0, 13.0, 16.0, 16.0, 2.0, 0.0, 0.0, 11.0, 16.0, 15.0, 8.0, 4.0, 0.0, 0.0, 0.0, 8.0, 14.0, 11.0, 1.0, 0.0, 0.0, 0.0, 0.0, 8.0, 16.0, 16.0, 14.0, 0.0, 0.0, 0.0, 0.0, 1.0, 6.0, 6.0, 16.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 5.0, 16.0, 3.0, 0.0, 0.0, 0.0, 1.0, 5.0, 15.0, 13.0, 0.0, 0.0, 0.0, 0.0, 4.0, 15.0, 16.0, 2.0, 0.0, 0.0, 0.0 ] ]
}

Attaching is a screenshot on how to pass JSON input under deployment

enter image description here

I just verified the notebook and you don't have to change the ML URL.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Why when i try push my Spring boot app to heroku it return "Fatal error compiling: invalid target release: 11"

JMeter: Why get error when try to save test plan

Why do I get an "invalid values" error when I try to access the network settings on Eclipse Mars?

I keep getting the following error when I try to take in user input - ValueError: invalid literal for int() with base 10: ''

I get Invalid argument error when try to addRule to stylesheet in ie

How can I solve the 'could not convert string to float:' error when I try to embed sequence data in a keras model

Why is Google Cloud Functions throwing a "Invalid value for config firebase.databaseURL" error when I try to initialize a firebase app?

Why is Cosmos DB giving me an "The input name '{' is invalid" error when I call CreateItemAsync

"amount is invalid" error when i try to withdraw in Bitmex (ccxt)

Why I am getting an error when i try to save form into quiz model with entity framework?

DeepLearning: Got error when try to import one test data into model

error when I try to fill table with data

Why do I get this error in my logcat when I try to post JSON data?

Make file error when I try to do with linking the test file

Why do I get a type error in model.predictOnValues when I try the official example of Streaming Kmeans Clustering of Apache Spark?

Why is the Visual Studio 2013 debugger closing without error when I try to expand Model properties?

Why are no parameters passed in when I try to test my API with Postman?

Mean stack deployed successfully on heroku but I get Application Error

Uncaught SyntaxError: Unexpected end of JSON input error when i try to take data from mysql

Error on jest when I try to run the test

Django error:name '_' is not defined,when I try to create a new model

Why do I get a NoClassDefFound error when I try to save my test plan?

When I try to download StanfordNLP en model, it gives an error

Gcc throws error when I try to compile the test folder in libburn

Why do I get an error when I try to save mongoose model?

Application Error on Heroku but model successfully deployed

Python/Terminal - Why am I getting this error message when I try to get user input

Why my data get undefined when I successfully get the response?

Why my test_index is empty when I try to stratified it?

TOP Ranking

  1. 1

    Failed to listen on localhost:8000 (reason: Cannot assign requested address)

  2. 2

    Loopback Error: connect ECONNREFUSED 127.0.0.1:3306 (MAMP)

  3. 3

    How to import an asset in swift using Bundle.main.path() in a react-native native module

  4. 4

    pump.io port in URL

  5. 5

    Compiler error CS0246 (type or namespace not found) on using Ninject in ASP.NET vNext

  6. 6

    BigQuery - concatenate ignoring NULL

  7. 7

    ngClass error (Can't bind ngClass since it isn't a known property of div) in Angular 11.0.3

  8. 8

    ggplotly no applicable method for 'plotly_build' applied to an object of class "NULL" if statements

  9. 9

    Spring Boot JPA PostgreSQL Web App - Internal Authentication Error

  10. 10

    How to remove the extra space from right in a webview?

  11. 11

    java.lang.NullPointerException: Cannot read the array length because "<local3>" is null

  12. 12

    Jquery different data trapped from direct mousedown event and simulation via $(this).trigger('mousedown');

  13. 13

    flutter: dropdown item programmatically unselect problem

  14. 14

    How to use merge windows unallocated space into Ubuntu using GParted?

  15. 15

    Change dd-mm-yyyy date format of dataframe date column to yyyy-mm-dd

  16. 16

    Nuget add packages gives access denied errors

  17. 17

    Svchost high CPU from Microsoft.BingWeather app errors

  18. 18

    Can't pre-populate phone number and message body in SMS link on iPhones when SMS app is not running in the background

  19. 19

    12.04.3--- Dconf Editor won't show com>canonical>unity option

  20. 20

    Any way to remove trailing whitespace *FOR EDITED* lines in Eclipse [for Java]?

  21. 21

    maven-jaxb2-plugin cannot generate classes due to two declarations cause a collision in ObjectFactory class

HotTag

Archive