-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The ML engine library does not work. #241
Comments
Hi @Mistobaan , how are you? Were you able to use ML's predict api in golang? I'm trying and it always makes mistakes. |
Yes, apply that patch and is able to do the prediction correctly. Keep in mind that how you setup the input of the model is important too. |
Thanks I was able to call api predict! I did according to your path. |
Thanks, this has been very helpful! Before patching the json payload got wrapped in a http body, which resulted in the following error message in the Cloud ML Engine logs:
|
Mistake:Appears to be fixed @Mistobaan |
Unfortunately the new version (2018-04-26) still doesn't work for me, error is the same as before. |
@christiansteck Sorry, I was using a vendored version by mistake. I published this patch to GitHub as a temporary fix. Hopefully it works for you. import "github.com/tensortask/go-ml-engine/v1" |
I have the same problem. How is the progress and when will this be fixed? |
We're actively working on this. Sorry, no ETA yet. |
We are also desperately waiting for a solution here. Especially, since with go1.11 modules we can not vendor our own patch anymore and do not really want to create a separate fork for this. |
This is on my radar, but we're dealing with several high priority issues at the moment. I'm hoping to return to this soon. |
Releated to #241. Change-Id: I577740c3a2f0f88ffc23ac4850dba3f38872ae17 Reviewed-on: https://code-review.googlesource.com/c/34810 Reviewed-by: Jean de Klerk <deklerk@google.com>
Works like a charm 🎉. Thanks for your effort. |
This takes a different approach than the changes made for the ML API (see #241). Healthcare and ML API, strangely, have different formats for HttpBody. They are the only two APIs currently using HttpBody. This change makes any HttpBody call accept an io.Reader, which is used as the HTTP request's Body. Headers can be added using the existing Header() function on the Call. Additional headers and parameters are not added, nor is any processing done on the response. This is quite a bit better than requiring users construct their own *http.Request, because they get type safety on the correct method and URL path parameters via the discovery service. Updates #344. Code looks like this to use: call := fhirService.CreateResource(parent, resourceType, bytes.NewReader(jsonPayload)) call.Header().Set("Content-Type", "application/fhir+json;charset=utf-8") resp, err := call.Do() if err != nil { return fmt.Errorf("CreateResource: %v", err) } defer resp.Body.Close() if resp.StatusCode > 299 { return fmt.Errorf("CreateResource: status %d %s", resp.StatusCode, resp.Status) } respBytes, err := ioutil.ReadAll(resp.Body) if err != nil { return fmt.Errorf("Could not read response: %v", err) } Change-Id: I87cbf7535fbdeacf8cf74ba4ead82ecbd9f187f8 Reviewed-on: https://code-review.googlesource.com/c/google-api-go-client/+/39310 Reviewed-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Tyler Bui-Palsulich <tbp@google.com> Reviewed-by: Jean de Klerk <deklerk@google.com>
I have to manually patch the library to make it work:
creating the request with:
and calling the service with:
The text was updated successfully, but these errors were encountered: