{"id":16539779,"url":"https://github.com/rickstaa/tf23-sess-run-performance-slowdown","last_synced_at":"2025-03-04T03:19:51.195Z","repository":{"id":104253657,"uuid":"299322759","full_name":"rickstaa/tf23-sess-run-performance-slowdown","owner":"rickstaa","description":"A small repository to incvesitgate why the tf.sess.run command is slower in tf2.3 than in tf1.15.","archived":false,"fork":false,"pushed_at":"2020-09-28T15:23:28.000Z","size":252,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-14T07:28:54.738Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","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/rickstaa.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":"2020-09-28T13:47:39.000Z","updated_at":"2020-11-04T09:47:34.000Z","dependencies_parsed_at":"2023-07-22T11:35:11.947Z","dependency_job_id":null,"html_url":"https://github.com/rickstaa/tf23-sess-run-performance-slowdown","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/rickstaa%2Ftf23-sess-run-performance-slowdown","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rickstaa%2Ftf23-sess-run-performance-slowdown/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rickstaa%2Ftf23-sess-run-performance-slowdown/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rickstaa%2Ftf23-sess-run-performance-slowdown/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rickstaa","download_url":"https://codeload.github.com/rickstaa/tf23-sess-run-performance-slowdown/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241773824,"owners_count":20018173,"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":[],"created_at":"2024-10-11T18:50:32.274Z","updated_at":"2025-03-04T03:19:51.178Z","avatar_url":"https://github.com/rickstaa.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TF2.3 session.run performance drop\n\nThis folder can be used to investigate the performance drop that is found when you\nuse the session.run command in [tf2_3](https://www.tensorflow.org/api_docs/python/tf) compared to [tf1.15](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf).\n\n## Use instructions\n\n### Conda environment\n\nFrom the general python package sanity perspective, it is a good idea to use conda\nenvironments to make sure packages from different projects do not interfere with each\nother. We will therefore create to conda environments to compare the performance difference between [tf2_3](https://www.tensorflow.org/api_docs/python/tf) and [tf1.15](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf).\n\n#### Create tf1.15 environment\n\nTo create the first conda environment run the following command:\n\n```bash\nconda create -n tf115_performance_test python=3.6\n```\n\nTo activate the env:\n\n```bash\nconda activate tf115_performance_test\n```\n\nYou can then install the required packages using the following command:\n\n```bash\npip install -r requirements_tf1_15.txt\n```\n\n#### Create tf2.3 environment\n\nTo create the first conda environment run the following command:\n\n```bash\nconda create -n tf23_performance_test python=3.8\n```\n\nTo activate the env:\n\n```bash\nconda activate tf23_performance_test\n```\n\nYou can then install the required packages using the following command:\n\n```bash\npip install -r requirements_tf1_15.txt\n```\n\n## How to run\n\nWhen both environments are created you can use the\n[spyder](https://docs.spyder-ide.org/current/profiler.html) or\n[cprofiler](https://docs.python.org/2/library/profile.html) to investigate\nthe difference in execution time. The cprofiler run command is:\n\n```bash\npython -m cProfile -o tf_115.cprof tf_1_15_vs_tf2_3_sess_speed_compare.py\n```\n\nTo investigate the report you can use the following command:\n\n```bash\npyprof2calltree -k -i tf_115.cprof\n```\n\nFor this to work you need to install the `kcachegrind` debian package.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frickstaa%2Ftf23-sess-run-performance-slowdown","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frickstaa%2Ftf23-sess-run-performance-slowdown","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frickstaa%2Ftf23-sess-run-performance-slowdown/lists"}