{"id":19696494,"url":"https://github.com/marstechhan/tfpatcher","last_synced_at":"2025-04-29T11:32:07.734Z","repository":{"id":54383820,"uuid":"230067813","full_name":"MarsTechHAN/tfpatcher","owner":"MarsTechHAN","description":"A tool for patching the TensorFlow frozen protobuf file for compatibility to RKNN \u0026 SNPE SDK.","archived":false,"fork":false,"pushed_at":"2021-02-22T04:27:52.000Z","size":25,"stargazers_count":11,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-05T15:11:20.216Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","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/MarsTechHAN.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":"2019-12-25T08:11:40.000Z","updated_at":"2023-11-13T08:13:11.000Z","dependencies_parsed_at":"2022-08-13T14:00:58.613Z","dependency_job_id":null,"html_url":"https://github.com/MarsTechHAN/tfpatcher","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/MarsTechHAN%2Ftfpatcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarsTechHAN%2Ftfpatcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarsTechHAN%2Ftfpatcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarsTechHAN%2Ftfpatcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MarsTechHAN","download_url":"https://codeload.github.com/MarsTechHAN/tfpatcher/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251494014,"owners_count":21598217,"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-11-11T19:35:22.459Z","updated_at":"2025-04-29T11:32:06.940Z","avatar_url":"https://github.com/MarsTechHAN.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tfpatcher\nA ugly written tool for patching the tensorflow forzen protobuf file for compatibility to RKNN \u0026amp; SNPE SDK.\n\nThe program will do following things:\n1. Check for 'explicit_paddings' attribution and removed. SNPE's built-in tf cannot read.\n2. Check for 'reduce_dim' attribution for Mean operator, if it is true (reduce demension from [1,1,1,1280] to [1, 1280]), changed it to false, and add reshape function after it. Also, all '_output_shapes' attribution will be removed, since the shapes have changed.  SNPE dont support Mean with reduce_dim=true.\n3. Check for 'FusedBatchNormV3' operator, and replace it with 'FusedBatchNorm' and remove 'U' attr. Both SNPE and RKNN dont support it yet.\n4. Check for 'swish_f32', and replace with a 'Sigmoid' and 'mul', both SNPE and RKNN don't read and interpret the node_def section. \n\nTest working networks:\n- efficientnet_b0\n- efficientnet_b1\n- mnasnet-a1\n- mobilenet_v1\n- mobilenet_v2\n- nasnet_a_mobile\n- resnet_v2\n\nUsage:\n```\n#First run will convert pb to pbtxt\npython3 .\\frozenpb_patcher.py .\\efficientnet_b0.pb\n\n#Second run will do the patching.\npython3 .\\frozenpb_patcher.py .\\efficientnet_b0.pb\n#python3 .\\frozenpb_patcher.py .\\nasnet_a_mobile.pb nasnet (nasnet has 1056 channels, unlink common 1280 channels)\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarstechhan%2Ftfpatcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarstechhan%2Ftfpatcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarstechhan%2Ftfpatcher/lists"}