{"id":13717156,"url":"https://github.com/albanie/pytorch-mcn","last_synced_at":"2025-05-07T06:31:57.997Z","repository":{"id":70869395,"uuid":"115009834","full_name":"albanie/pytorch-mcn","owner":"albanie","description":"Convert models from MatConvNet to PyTorch","archived":false,"fork":false,"pushed_at":"2019-01-06T11:22:54.000Z","size":176,"stargazers_count":94,"open_issues_count":3,"forks_count":13,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-14T05:33:53.639Z","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/albanie.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2017-12-21T13:39:54.000Z","updated_at":"2024-10-29T08:45:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"06baa476-62db-4bdd-a156-cade8d7584d2","html_url":"https://github.com/albanie/pytorch-mcn","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/albanie%2Fpytorch-mcn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albanie%2Fpytorch-mcn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albanie%2Fpytorch-mcn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albanie%2Fpytorch-mcn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/albanie","download_url":"https://codeload.github.com/albanie/pytorch-mcn/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252826900,"owners_count":21810201,"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-08-03T00:01:18.599Z","updated_at":"2025-05-07T06:31:57.992Z","avatar_url":"https://github.com/albanie.png","language":"Python","funding_links":[],"categories":["Pytorch \u0026 related libraries｜Pytorch \u0026 相关库","Pytorch \u0026 related libraries"],"sub_categories":["Other libraries｜其他库:","Other libraries:"],"readme":"pytorch-mcn\n---\n\nA tool for importing trained MatConvNet models into Pytorch (if you were hoping to go the other way, try [mcnPyTorch](https://github.com/albanie/mcnPyTorch)).\n\n### Demo\n\nTo run the importer, set the path to the MatConvNet model and supply an output directory (where the imported PyTorch models will be stored) in the `importer.sh` script.  There are a few examples in the script which can be commented/uncommented to run as a demo.  Then run `bash importer.sh`.\n\n### Imported Models\n\nA number of standard models have been imported and verified, and can be found [here](http://www.robots.ox.ac.uk/~albanie/pytorch-models.html).\n\n### Verification\n\nVerifying an imported model requires MATLAB and a copy of MatConvNet (the specific dependencies are given in `compare/startup.m`).  The process is as follows:\n\n1. Run the `compare/featureDumper.m` script to dump intermediate features from the original MatConvNet model to disk.\n2. Import model to PyTorch in `debug_mode` (an option that can be set in `importer.sh`.  This will generate additional source code in the PyTorch model definition that stores every intermediate tensor computed by the network.\n3. Run the `compare/compare_models.py` script, which will perform a numerical comparison between the tensors.\n\n\n### Notes\n\nModel conversion between frameworks can be challenging, because the layers and modules of each framework do not have an exact correspondence. As a result, there is often a bit of work involved in the conversion process, particularly for non-standard architectures.\n\nThis tool requires at least Python 3.5 and PyTorch 0.3.0 (by default, `ipython` will be used, but you can switch to standard python by changing a config variable in `importer.sh`).  The tool expects the MatConvNet models to be in `dagnn` format (the [ensure_dags.m](compare/ensure_dags.m) script converts models to this format from SimpleNN if required).\n\nIdeally in future the model conversion process will run via onnx but it seems that currently quite a lot of support is missing for required functionality.  The plan is therefore to update the converter when possible.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falbanie%2Fpytorch-mcn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falbanie%2Fpytorch-mcn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falbanie%2Fpytorch-mcn/lists"}