{"id":18371230,"url":"https://github.com/sub-mod/tf-mnist","last_synced_at":"2026-05-02T03:08:51.733Z","repository":{"id":39740614,"uuid":"214266218","full_name":"sub-mod/tf-mnist","owner":"sub-mod","description":"MNIST digit identification with Tensorflow and s2i","archived":false,"fork":false,"pushed_at":"2023-03-24T21:54:11.000Z","size":61,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-11T00:27:13.292Z","etag":null,"topics":["openshift","s2i","tekton-pipelines","tensorflow"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sub-mod.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-10T19:16:25.000Z","updated_at":"2019-10-16T17:16:29.000Z","dependencies_parsed_at":"2024-11-05T23:43:33.307Z","dependency_job_id":"ba4e8495-51ce-4863-b7c0-549208f20f3e","html_url":"https://github.com/sub-mod/tf-mnist","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sub-mod/tf-mnist","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sub-mod%2Ftf-mnist","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sub-mod%2Ftf-mnist/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sub-mod%2Ftf-mnist/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sub-mod%2Ftf-mnist/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sub-mod","download_url":"https://codeload.github.com/sub-mod/tf-mnist/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sub-mod%2Ftf-mnist/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32521139,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-02T01:12:54.858Z","status":"online","status_checked_at":"2026-05-02T02:00:05.923Z","response_time":132,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["openshift","s2i","tekton-pipelines","tensorflow"],"created_at":"2024-11-05T23:43:22.338Z","updated_at":"2026-05-02T03:08:51.718Z","avatar_url":"https://github.com/sub-mod.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tf-mnist\n## MNIST in TensorFlow\n\nThis directory builds a convolutional neural net to classify the [MNIST\ndataset](http://yann.lecun.com/exdb/mnist/) using the\n[tf.data](https://www.tensorflow.org/api_docs/python/tf/data),\n[tf.estimator.Estimator](https://www.tensorflow.org/api_docs/python/tf/estimator/Estimator),\nand\n[tf.layers](https://www.tensorflow.org/api_docs/python/tf/layers)\nAPIs.Tensorflow 1.15.0 is used in this example.TF-2.0.0 is not supported.\n\n\n## Setup\n\nTo build application using standalone S2I and then run the resulting image with Docker execute:\n```shell\ns2i build .  centos/python-36-centos7 mnist-python\n```\n\nTo train the model, run the following:\n\n```\ndocker run -it mnist-python\n```\nThis runs the app.sh script  \n```\npython official/mnist/mnist.py --data_format 'channels_last' --stop_threshold '0.96'\n```\n\nThe model will begin training and will automatically evaluate itself on the\nvalidation data.The checkpoint folder is `/tmp/mnist_model/model.ckpt`.  \n\n## Exporting the model\n\nYou can export the model into Tensorflow [SavedModel](https://www.tensorflow.org/guide/saved_model) format by using the argument `--export_dir`:\n\n```\npython mnist.py --data_format 'channels_last' --stop_threshold '0.96' --export_dir /tmp/mnist_saved_model\n```\n\nThe SavedModel will be saved in a timestamped directory under `/tmp/mnist_saved_model/` (e.g. `/tmp/mnist_saved_model/1513630966/`).\n\n**Getting predictions with SavedModel**\nUse [`saved_model_cli`](https://www.tensorflow.org/guide/saved_model#cli_to_inspect_and_execute_savedmodel) to inspect and execute the SavedModel.\n\n```\nsaved_model_cli run --dir /tmp/mnist_saved_model/TIMESTAMP --tag_set serve --signature_def classify --inputs image=/opt/app-root/src/official/mnist/examples.npy\n```\n\n`examples.npy` contains the data from `example5.png` and `example3.png` in a numpy array, in that order. The array values are normalized to values between 0 and 1.\n\nThe output should look similar to below:\n```\nResult for output key classes:\n[5 3]\nResult for output key probabilities:\n[[  1.53558474e-07   1.95694142e-13   1.31193523e-09   5.47467265e-03\n    5.85711526e-22   9.94520664e-01   3.48423509e-06   2.65365645e-17\n    9.78631419e-07   3.15522470e-08]\n [  1.22413359e-04   5.87615965e-08   1.72251271e-06   9.39960718e-01\n    3.30306928e-11   2.87386645e-02   2.82353517e-02   8.21146413e-18\n    2.52568233e-03   4.15460236e-04]]\n```\n\n## Experimental: Eager Execution\n\n[Eager execution](https://research.googleblog.com/2017/10/eager-execution-imperative-define-by.html)\n(an preview feature in TensorFlow 1.5) is an imperative interface to TensorFlow.\nThe exact same model defined in `mnist.py` can be trained without creating a\nTensorFlow graph using:\n\n```\npython mnist_eager.py\n```\n\n## Credits\n\nTensorFlow Authors  \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsub-mod%2Ftf-mnist","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsub-mod%2Ftf-mnist","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsub-mod%2Ftf-mnist/lists"}