Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Prediction failed: Error during model execution:
- AbortionError(code=StatusCode.INVALID_ARGUMENT, details="Expected image
- (JPEG, PNG, or GIF), got unknown format starting with
- 'u253Z212f240{370351z 06332261356270377'
- [[{{node map/while/DecodeJpeg}} = DecodeJpeg[_output_shapes=[[?,?,3]],
- acceptable_fraction=1, channels=3, dct_method="", fancy_upscaling=true,
- ratio=1, try_recover_truncated=false, _device="/job:localhost/replica:0
- /task:0/device:CPU:0"](map/while/TensorArrayReadV3)]]")
- <script type="text/javascript">
- function simulateClick(bunnyID) {
- document.getElementById(bunnyID).click();
- }
- $(document).ready(function () {
- $("#loading").hide();
- $("span.mdl-chip").hide();
- console.log("ready!");
- $("#settings-btn").click(function () {
- $("#versions").toggle();
- });
- let base64Image;
- $("#image-selector").change(function () {
- let reader = new FileReader();
- reader.onload = function (e) {
- let dataURL = reader.result;
- $("#selected-image").attr("src", dataURL);
- base64Image = dataURL.replace("data:image/jpg;base64,","");
- console.log(base64Image);
- }
- let file = $("#image-selector").prop('files')[0];
- reader.readAsDataURL(file);
- setTimeout(simulateClick.bind(null,'fake-predict-button'), 500);
- });
- $("#fake-predict-button").click(function () {
- let baseImage = {
- image: base64Image
- }
- console.log(baseImage);
- $("span.mdl-chip").hide();
- $("#no-skins").hide();
- $("#loading").show();
- var modelUrl;
- var modelSelection = $('input[name=options]:checked').val();
- if (modelSelection === "1") {
- modelUrl = "test/versions/v1"
- } else {
- modelUrl = $("#custom").val()
- }
- $.ajax({
- type: "POST",
- url: "https://MY-HTTP-ENDPOINT",
- data: {
- "instances": [{"image_bytes": {"b64": base64Image}}]},
- JSON.stringify({
- "model": modelUrl}),
- },
- contentType: "application/json; charset=utf-8",
- dataType: "json",
Add Comment
Please, Sign In to add comment