machinebox / issues

Machine Box issues, bugs and feature requests
2 stars 0 forks source link

classificationbox: #18

Closed prasanna-in closed 6 years ago

prasanna-in commented 6 years ago

classificationbox v0 (development)

http://localhost:8080/classificationbox/models/sentiment2/teach

{ "class": "Img_URL", "inputs": [ { "key": "user_age", "type": "image_url", "value": "https://db.creditcard/wp-content/uploads/2016/10/bankamericard_travel_rewards_credit_card.png"

    }
]

}

Response :

{ "success": false, "error": "sentiment2:sentimentModel2 could not preprocess the input: could not pre process the image for feature 'user_age': model predict image returns an error Traceback (most recent call last):\n File \"/tmp/mb439721528\", line 49, in predict_img\n File \"/env/local/lib/python2.7/site-packages/keras/engine/training.py\", line 1695, in predict\n check_batch_axis=False)\n File \"/env/local/lib/python2.7/site-packages/keras/engine/training.py\", line 144, in _standardize_input_data\n str(array.shape))\nValueError: Error when checking : expected input_1 to have shape (None, None, None, 3) but got array with shape (1, 299, 299, 1)\n" }

prasanna-in commented 6 years ago

Looks Like PNG Processing Error

dahernan commented 6 years ago

Yes, it looks like that PNG has only 1 channel (grayscale) instead of 3 (rgb), I'll try to fix it, meanwhile you can convert that png to rgb with some image tools

dahernan commented 6 years ago

Yeah converting that image to JPG and removing alpha channel it works well, we suppose to handle that case, but that PNG returns a strange shape

dahernan commented 6 years ago

Is fixed now docker pull machinebox/classificationbox:latest to get the changes