{"id":23324398,"url":"https://github.com/applifier/go-tensorflow","last_synced_at":"2025-08-22T18:32:36.083Z","repository":{"id":55868485,"uuid":"135398351","full_name":"Applifier/go-tensorflow","owner":"Applifier","description":"Tools and libraries for using Tensorflow (and Tensorflow Serving) in go","archived":false,"fork":false,"pushed_at":"2021-04-07T13:59:29.000Z","size":6804,"stargazers_count":30,"open_issues_count":0,"forks_count":4,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-11-16T03:40:28.275Z","etag":null,"topics":["go","golang","grpc","ml","tensorflow","tensorflow-serving"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Applifier.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-30T06:31:42.000Z","updated_at":"2024-08-02T11:33:37.000Z","dependencies_parsed_at":"2022-08-15T08:10:27.889Z","dependency_job_id":null,"html_url":"https://github.com/Applifier/go-tensorflow","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Applifier%2Fgo-tensorflow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Applifier%2Fgo-tensorflow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Applifier%2Fgo-tensorflow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Applifier%2Fgo-tensorflow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Applifier","download_url":"https://codeload.github.com/Applifier/go-tensorflow/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230626757,"owners_count":18255689,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","golang","grpc","ml","tensorflow","tensorflow-serving"],"created_at":"2024-12-20T18:14:17.769Z","updated_at":"2024-12-20T18:14:18.197Z","avatar_url":"https://github.com/Applifier.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![GoDoc](https://godoc.org/github.com/Applifier/go-tensorflow?status.svg)](http://godoc.org/github.com/Applifier/go-tensorflow)\n[![Build Status](https://travis-ci.org/Applifier/go-tensorflow.svg?branch=master)](https://travis-ci.org/Applifier/go-tensorflow)\n\n# go-tensorflow\n\nUnified interface for TensorFlow prediction for both embedded models and calls to Tensorflow Serving. Implementations automatically convert go types into matching TensorFlow Tensors.\n\nModels should be exported in the SavedModel format.\n\n### Example\n\nExample uses pre-trained model found under testdata/models [wide_deep](https://github.com/tensorflow/models/tree/master/official/wide_deep)\n\n```go\nimport \"github.com/Applifier/go-tensorflow/savedmodel\"\n// import \"github.com/Applifier/go-tensorflow/serving\"\n```\n\n```go\n\n// Uncomment line below to switch implementation\n// predictor := serving.NewPredictor(servingModelClient)\npredictor, _ := savedmodel.NewPredictor(\"testdata/models\", \"wide_deep\", 1527087570, \"serving_default\")\n\n\nm := map[string]interface{}{\n    \"age\":            35.0,\n    \"capital_gain\":   0.0,\n    \"capital_loss\":   0.0,\n    \"education\":      \"Masters\",\n    \"education_num\":  14.0,\n    \"gender\":         \"Female\",\n    \"hours_per_week\": 29.0,\n    \"native_country\": \"United-States\",\n    \"occupation\":     \"Prof-specialty\",\n    \"relationship\":   \"Husband\",\n    \"workclass\":      \"Private\",\n}\n\nres, modelInfo, _ := predictor.Predict(\n    context.Background(),\n    map[string]interface{}{\n        \"inputs\": m,\n    },\n    nil,\n)\n\nscores := res[\"scores\"].Value().([][]float32)\n\nfmt.Printf(\"scores %+v\\n\", scores[0])\n\n// Output: scores [0.54612064 0.45387936]\n\nfmt.Printf(\"model name %s, version %s\", modelInfo.Name, modelInfo.Version)\n// Output: model name wide_deep, version 1527087570\n\n```\n\n\n## License\n\n[MIT](https://github.com/Applifier/go-tensorflow/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapplifier%2Fgo-tensorflow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapplifier%2Fgo-tensorflow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapplifier%2Fgo-tensorflow/lists"}