{"id":15028986,"url":"https://github.com/lanpa/tensorboardx","last_synced_at":"2025-09-09T20:43:51.460Z","repository":{"id":38239275,"uuid":"94218531","full_name":"lanpa/tensorboardX","owner":"lanpa","description":"tensorboard for pytorch (and chainer, mxnet, numpy, ...)","archived":false,"fork":false,"pushed_at":"2025-09-05T07:51:39.000Z","size":5870,"stargazers_count":7965,"open_issues_count":89,"forks_count":859,"subscribers_count":84,"default_branch":"master","last_synced_at":"2025-09-05T09:31:32.822Z","etag":null,"topics":["machine-learning","numpy","pytorch","tensorboard","visualization"],"latest_commit_sha":null,"homepage":"https://tensorboardx.readthedocs.io/en/latest/tensorboard.html","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/lanpa.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.rst","contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2017-06-13T13:54:19.000Z","updated_at":"2025-09-05T08:37:26.000Z","dependencies_parsed_at":"2023-02-13T23:30:55.787Z","dependency_job_id":"b082e746-2b27-480e-9cf5-26e50a162270","html_url":"https://github.com/lanpa/tensorboardX","commit_stats":{"total_commits":478,"total_committers":84,"mean_commits":5.690476190476191,"dds":0.299163179916318,"last_synced_commit":"ce08ab4ca1ebb0e8d09d140dbc1531f3923490a7"},"previous_names":["lanpa/tensorboard-pytorch"],"tags_count":23,"template":false,"template_full_name":null,"purl":"pkg:github/lanpa/tensorboardX","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lanpa%2FtensorboardX","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lanpa%2FtensorboardX/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lanpa%2FtensorboardX/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lanpa%2FtensorboardX/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lanpa","download_url":"https://codeload.github.com/lanpa/tensorboardX/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lanpa%2FtensorboardX/sbom","scorecard":{"id":578632,"data":{"date":"2025-08-11","repo":{"name":"github.com/lanpa/tensorboardX","commit":"ca5072b12f22143dc9cc8ec93b978e4347097677"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.9,"checks":[{"name":"Code-Review","score":1,"reason":"Found 5/26 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":1,"reason":"2 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/build-wheel.yml:1","Warn: no topLevel permission defined: .github/workflows/publish-pypi.yml:1","Warn: no topLevel permission defined: .github/workflows/test-matrix.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Pinned-Dependencies","score":1,"reason":"dependency not pinned by hash detected -- score normalized to 1","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build-wheel.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/lanpa/tensorboardX/build-wheel.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build-wheel.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/lanpa/tensorboardX/build-wheel.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build-wheel.yml:37: update your workflow using https://app.stepsecurity.io/secureworkflow/lanpa/tensorboardX/build-wheel.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build-wheel.yml:52: update your workflow using https://app.stepsecurity.io/secureworkflow/lanpa/tensorboardX/build-wheel.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build-wheel.yml:54: update your workflow using https://app.stepsecurity.io/secureworkflow/lanpa/tensorboardX/build-wheel.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build-wheel.yml:59: update your workflow using https://app.stepsecurity.io/secureworkflow/lanpa/tensorboardX/build-wheel.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build-wheel.yml:78: update your workflow using https://app.stepsecurity.io/secureworkflow/lanpa/tensorboardX/build-wheel.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish-pypi.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/lanpa/tensorboardX/publish-pypi.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish-pypi.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/lanpa/tensorboardX/publish-pypi.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/publish-pypi.yml:72: update your workflow using https://app.stepsecurity.io/secureworkflow/lanpa/tensorboardX/publish-pypi.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/publish-pypi.yml:79: update your workflow using https://app.stepsecurity.io/secureworkflow/lanpa/tensorboardX/publish-pypi.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-matrix.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/lanpa/tensorboardX/test-matrix.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-matrix.yml:52: update your workflow using https://app.stepsecurity.io/secureworkflow/lanpa/tensorboardX/test-matrix.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-matrix.yml:74: update your workflow using https://app.stepsecurity.io/secureworkflow/lanpa/tensorboardX/test-matrix.yml/master?enable=pin","Warn: pipCommand not pinned by hash: run_pytest.sh:5","Warn: pipCommand not pinned by hash: .github/workflows/build-wheel.yml:25","Warn: pipCommand not pinned by hash: .github/workflows/build-wheel.yml:68","Warn: pipCommand not pinned by hash: .github/workflows/publish-pypi.yml:47","Warn: downloadThenRun not pinned by hash: .github/workflows/test-matrix.yml:55","Warn: downloadThenRun not pinned by hash: .github/workflows/test-matrix.yml:77","Warn: downloadThenRun not pinned by hash: .github/workflows/test-matrix.yml:24","Info:   0 out of  12 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned","Info:   2 out of   6 pipCommand dependencies pinned","Info:   0 out of   3 downloadThenRun dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/publish-pypi.yml:17"],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v2.1 not signed: https://api.github.com/repos/lanpa/tensorboardX/releases/28233983","Warn: release artifact v2.1 does not have provenance: https://api.github.com/repos/lanpa/tensorboardX/releases/28233983"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"21 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2018-34 / GHSA-2fc2-6r4j-p65h","Warn: Project is vulnerable to: PYSEC-2021-856 / GHSA-5545-2q6w-2gh6","Warn: Project is vulnerable to: PYSEC-2019-108 / GHSA-9fq2-x9r6-wfmf","Warn: Project is vulnerable to: PYSEC-2018-33 / GHSA-cw6w-4rcx-xphc","Warn: Project is vulnerable to: PYSEC-2021-857 / GHSA-f7c7-j99h-c22f","Warn: Project is vulnerable to: GHSA-fpfv-jqm9-f5jm","Warn: Project is vulnerable to: PYSEC-2017-1 / GHSA-frgw-fgh6-9g52","Warn: Project is vulnerable to: GHSA-6rq9-53c3-f7vj","Warn: Project is vulnerable to: PYSEC-2023-38 / GHSA-ffxj-547x-5j7c","Warn: Project is vulnerable to: PYSEC-2025-10 / GHSA-h36j-8vv3-cj52","Warn: Project is vulnerable to: PYSEC-2024-223 / GHSA-h8wv-9h96-m4hr","Warn: Project is vulnerable to: PYSEC-2024-222 / GHSA-whh8-fjgc-qp73","Warn: Project is vulnerable to: GHSA-8qvm-5x2c-j2w7","Warn: Project is vulnerable to: GHSA-3749-ghw9-m3mg","Warn: Project is vulnerable to: PYSEC-2022-43015 / GHSA-47fc-vmwq-366v","Warn: Project is vulnerable to: PYSEC-2025-41 / GHSA-53q9-r3pm-6pq6","Warn: Project is vulnerable to: PYSEC-2024-252 / GHSA-5pcm-hx3q-hm94","Warn: Project is vulnerable to: GHSA-887c-mr87-cxwp","Warn: Project is vulnerable to: PYSEC-2024-251 / GHSA-pg7h-5qx3-wjr3","Warn: Project is vulnerable to: PYSEC-2024-250","Warn: Project is vulnerable to: PYSEC-2024-259"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 28 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-20T18:33:05.103Z","repository_id":38239275,"created_at":"2025-08-20T18:33:05.103Z","updated_at":"2025-08-20T18:33:05.103Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274358881,"owners_count":25270681,"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","status":"online","status_checked_at":"2025-09-09T02:00:10.223Z","response_time":80,"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":["machine-learning","numpy","pytorch","tensorboard","visualization"],"created_at":"2024-09-24T20:09:29.377Z","updated_at":"2025-09-09T20:43:51.435Z","avatar_url":"https://github.com/lanpa.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tensorboardX\n\n[![PyPI version](https://badge.fury.io/py/tensorboardX.svg)](https://badge.fury.io/py/tensorboardX)\n[![Documentation Status](https://readthedocs.org/projects/tensorboardx/badge/?version=latest)](https://tensorboardx.readthedocs.io/en/latest/?badge=latest)\n[![Coverage Status](https://codecov.io/gh/lanpa/tensorboardX/branch/master/graph/badge.svg)](https://codecov.io/gh/lanpa/tensorboardX/)\n\nWrite TensorBoard events with simple function call.\n\nThe current release (v2.6.3) is tested with PyTorch 2.6 / torchvision 0.21.0 / tensorboard 2.19.0 on Python 3.9 to 3.12\n\n* Support `scalar`, `image`, `figure`, `histogram`, `audio`, `text`, `graph`, `onnx_graph`, `embedding`, `pr_curve`, `mesh`, `hyper-parameters`\n  and `video` summaries.\n\n* [FAQ](https://github.com/lanpa/tensorboardX/wiki)\n\n\n## Install\n\n`pip install tensorboardX`\n\nor build from source:\n\n`pip install 'git+https://github.com/lanpa/tensorboardX'`\n\nYou can optionally install [`crc32c`](https://github.com/ICRAR/crc32c) to speed up.\n\n`pip install crc32c`\n\nStarting from tensorboardX 2.1, You need to install `soundfile` for the `add_audio()` function (200x speedup).\n\n`pip install soundfile`\n\n## Example\n\n* Clone the files in https://github.com/lanpa/tensorboardX/tree/master/examples\n* Run the demo script: e.g. `python examples/demo.py`\n* Start TensorBoard with `tensorboard --logdir runs`  \n\n\n```python\n# demo.py\n\nimport torch\nimport torchvision.utils as vutils\nimport numpy as np\nimport torchvision.models as models\nfrom torchvision import datasets\nfrom tensorboardX import SummaryWriter\n\nresnet18 = models.resnet18(False)\nwriter = SummaryWriter()\nsample_rate = 44100\nfreqs = [262, 294, 330, 349, 392, 440, 440, 440, 440, 440, 440]\n\nfor n_iter in range(100):\n\n    dummy_s1 = torch.rand(1)\n    dummy_s2 = torch.rand(1)\n    # data grouping by `slash`\n    writer.add_scalar('data/scalar1', dummy_s1[0], n_iter)\n    writer.add_scalar('data/scalar2', dummy_s2[0], n_iter)\n\n    writer.add_scalars('data/scalar_group', {'xsinx': n_iter * np.sin(n_iter),\n                                             'xcosx': n_iter * np.cos(n_iter),\n                                             'arctanx': np.arctan(n_iter)}, n_iter)\n\n    dummy_img = torch.rand(32, 3, 64, 64)  # output from network\n    if n_iter % 10 == 0:\n        x = vutils.make_grid(dummy_img, normalize=True, scale_each=True)\n        writer.add_image('Image', x, n_iter)\n\n        dummy_audio = torch.zeros(sample_rate * 2)\n        for i in range(x.size(0)):\n            # amplitude of sound should in [-1, 1]\n            dummy_audio[i] = np.cos(freqs[n_iter // 10] * np.pi * float(i) / float(sample_rate))\n        writer.add_audio('myAudio', dummy_audio, n_iter, sample_rate=sample_rate)\n\n        writer.add_text('Text', 'text logged at step:' + str(n_iter), n_iter)\n\n        for name, param in resnet18.named_parameters():\n            writer.add_histogram(name, param.clone().cpu().data.numpy(), n_iter)\n\n        # needs tensorboard 0.4RC or later\n        writer.add_pr_curve('xoxo', np.random.randint(2, size=100), np.random.rand(100), n_iter)\n\ndataset = datasets.MNIST('mnist', train=False, download=True)\nimages = dataset.test_data[:100].float()\nlabel = dataset.test_labels[:100]\n\nfeatures = images.view(100, 784)\nwriter.add_embedding(features, metadata=label, label_img=images.unsqueeze(1))\n\n# export scalar data to JSON for external processing\nwriter.export_scalars_to_json(\"./all_scalars.json\")\nwriter.close()\n```\n\n## Screenshots\n\n\u003cimg src=\"screenshots/Demo.gif\"\u003e\n\n## Using TensorboardX with Comet\n\nTensorboardX now supports logging directly to [Comet](https://www.comet.com/site/products/ml-experiment-tracking/?utm_source=tensorboardx\u0026utm_medium=partner\u0026utm_campaign=partner_tensorboardx_2023). Comet is a **free** cloud based solution that allows you to automatically track, compare and explain your experiments. It adds a lot of functionality on top of tensorboard such as dataset management, diffing experiments, seeing the code that generated the results and more.\n\nThis works out of the box and just require an additional line of code. See a full code example in this [Colab Notebook](https://colab.research.google.com/drive/1cTO3tgZ03nuJQ8kOjZhEiwbB-45tV4lm?usp=sharing)\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"screenshots/comet.gif\" width=\"750\" height=\"400\"\u003e\n\u003c/p\u003e\n\n## Tweaks\n\nTo add more ticks for the slider (show more image history), check https://github.com/lanpa/tensorboardX/issues/44 or \nhttps://github.com/tensorflow/tensorboard/pull/1138\n\n## Reference\n\n* [TeamHG-Memex/tensorboard_logger](https://github.com/TeamHG-Memex/tensorboard_logger)\n* [dmlc/tensorboard](https://github.com/dmlc/tensorboard)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flanpa%2Ftensorboardx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flanpa%2Ftensorboardx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flanpa%2Ftensorboardx/lists"}