[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-miracleyoo--pytorch-lightning-template":3,"tool-miracleyoo--pytorch-lightning-template":61},[4,18,26,36,44,53],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":17},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,3,"2026-04-06T06:32:30",[13,14,15,16],"Agent","开发框架","图像","数据工具","ready",{"id":19,"name":20,"github_repo":21,"description_zh":22,"stars":23,"difficulty_score":10,"last_commit_at":24,"category_tags":25,"status":17},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,"2026-04-05T11:01:52",[14,15,13],{"id":27,"name":28,"github_repo":29,"description_zh":30,"stars":31,"difficulty_score":32,"last_commit_at":33,"category_tags":34,"status":17},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",150720,2,"2026-04-11T11:33:10",[14,13,35],"语言模型",{"id":37,"name":38,"github_repo":39,"description_zh":40,"stars":41,"difficulty_score":32,"last_commit_at":42,"category_tags":43,"status":17},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",108322,"2026-04-10T11:39:34",[14,15,13],{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":32,"last_commit_at":50,"category_tags":51,"status":17},6121,"gemini-cli","google-gemini\u002Fgemini-cli","gemini-cli 是一款由谷歌推出的开源 AI 命令行工具，它将强大的 Gemini 大模型能力直接集成到用户的终端环境中。对于习惯在命令行工作的开发者而言，它提供了一条从输入提示词到获取模型响应的最短路径，无需切换窗口即可享受智能辅助。\n\n这款工具主要解决了开发过程中频繁上下文切换的痛点，让用户能在熟悉的终端界面内直接完成代码理解、生成、调试以及自动化运维任务。无论是查询大型代码库、根据草图生成应用，还是执行复杂的 Git 操作，gemini-cli 都能通过自然语言指令高效处理。\n\n它特别适合广大软件工程师、DevOps 人员及技术研究人员使用。其核心亮点包括支持高达 100 万 token 的超长上下文窗口，具备出色的逻辑推理能力；内置 Google 搜索、文件操作及 Shell 命令执行等实用工具；更独特的是，它支持 MCP（模型上下文协议），允许用户灵活扩展自定义集成，连接如图像生成等外部能力。此外，个人谷歌账号即可享受免费的额度支持，且项目基于 Apache 2.0 协议完全开源，是提升终端工作效率的理想助手。",100752,"2026-04-10T01:20:03",[52,13,15,14],"插件",{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":32,"last_commit_at":59,"category_tags":60,"status":17},4721,"markitdown","microsoft\u002Fmarkitdown","MarkItDown 是一款由微软 AutoGen 团队打造的轻量级 Python 工具，专为将各类文件高效转换为 Markdown 格式而设计。它支持 PDF、Word、Excel、PPT、图片（含 OCR）、音频（含语音转录）、HTML 乃至 YouTube 链接等多种格式的解析，能够精准提取文档中的标题、列表、表格和链接等关键结构信息。\n\n在人工智能应用日益普及的今天，大语言模型（LLM）虽擅长处理文本，却难以直接读取复杂的二进制办公文档。MarkItDown 恰好解决了这一痛点，它将非结构化或半结构化的文件转化为模型“原生理解”且 Token 效率极高的 Markdown 格式，成为连接本地文件与 AI 分析 pipeline 的理想桥梁。此外，它还提供了 MCP（模型上下文协议）服务器，可无缝集成到 Claude Desktop 等 LLM 应用中。\n\n这款工具特别适合开发者、数据科学家及 AI 研究人员使用，尤其是那些需要构建文档检索增强生成（RAG）系统、进行批量文本分析或希望让 AI 助手直接“阅读”本地文件的用户。虽然生成的内容也具备一定可读性，但其核心优势在于为机器",93400,"2026-04-06T19:52:38",[52,14],{"id":62,"github_repo":63,"name":64,"description_en":65,"description_zh":66,"ai_summary_zh":66,"readme_en":67,"readme_zh":68,"quickstart_zh":69,"use_case_zh":70,"hero_image_url":71,"owner_login":72,"owner_name":73,"owner_avatar_url":74,"owner_bio":75,"owner_company":76,"owner_location":77,"owner_email":78,"owner_twitter":79,"owner_website":80,"owner_url":81,"languages":82,"stars":95,"forks":96,"last_commit_at":97,"license":98,"difficulty_score":32,"env_os":99,"env_gpu":100,"env_ram":100,"env_deps":101,"category_tags":105,"github_topics":106,"view_count":32,"oss_zip_url":79,"oss_zip_packed_at":79,"status":17,"created_at":112,"updated_at":113,"faqs":114,"releases":134},6593,"miracleyoo\u002Fpytorch-lightning-template","pytorch-lightning-template","An easy\u002Fswift-to-adapt PyTorch-Lighting template. 套壳模板，简单易用，稍改原来Pytorch代码，即可适配Lightning。You can translate your previous Pytorch code much easier using this template, and keep your freedom to edit all the functions as well. Big-project-friendly as well. No need to rewrite your config in hydra.","pytorch-lightning-template 是一个专为 PyTorch Lightning 设计的轻量级项目模板，旨在帮助开发者快速将现有的 PyTorch 代码迁移至 Lightning 框架。它通过提供清晰的目录结构和标准化的接口文件，解决了原生 Lightning 学习曲线陡峭、模型与训练代码耦合度过高以及多项目间代码重复复制等痛点。\n\n该工具特别适合正在从事深度学习研发的研究人员和工程师，尤其是那些希望提升代码可维护性、复用性，却不愿被繁重配置束缚的用户。其核心亮点在于“解耦”设计：通过 `data_interface` 和 `model_interface` 统一封装数据加载与模型训练逻辑，用户只需关注具体的数据集定义或模型结构，无需反复重写样板代码。此外，它支持针对不同任务类型（如分类、超分辨率）的快速适配，并兼容 Hydra 配置管理，让大型项目的迭代更加高效流畅。如果你已熟悉 PyTorch 但想享受 Lightning 带来的工程化便利，这是一个平滑过渡的理想选择。","# Pytorch-Lightning-Template\n\n[**Chinese Version 中文版**](.\u002FAssets\u002FREADME_CN.md)\n\n## Introduction\n\nPytorch-Lightning is a very convenient library. It can be seen as an abstraction and packaging of Pytorch. Its advantages are strong reusability, easy maintenance, clear logic, etc. The disadvantage is that it is too heavy and requires quite a bit of time to learn and understand. In addition, since it directly binds the model and the training code, it is not suitable for real projects with multiple model and dataset files. The same is true for the data module design. The strong coupling of things like DataLoader and custom Datasets also causes a similar problem: the same code is copied and pasted inelegantly here and there.\n\nAfter much exploration and practice, I have summarized the following templates, which can also be a further abstraction of Pytorch-Lightning. In the first version, all the template content is under the root folder. However, after using it for more than a month, I found that more specified templates for different types of projects can boost coding efficiency. For example, classification and super-resolution tasks all have some fixed demand points. The project code can be implemented faster by directly modifying specialized templates, and some avoidable bugs have also been reduced. \n\n**Currently, since this is still a new library, there are only these two templates. However, later as I apply it to other projects, new specialized templates will also be added. If you have used this template for your tasks (such as NLP, GAN, speech recognition, etc.), you are welcome to submit a PR so that you can integrate your template into the library for more people to use. If your task is not on the list yet, starting from the `classification` template is a good choice. Since most of the underlying logic and code of the templates are the same, this can be done very quickly. **\n\nEveryone is welcome to try this set of code styles. It is quite convenient to reuse if you are used to it, and it is not easy to fall back into the hole. A more detailed explanation and a complete guide to Pytorch-Lightning can be found in the [this article](https:\u002F\u002Fzhuanlan.zhihu.com\u002Fp\u002F353985363) Zhihu blog.\n\n## File Structure\n\n```\nroot-\n\t|-data\n\t\t|-__init__.py\n\t\t|-data_interface.py\n\t\t|-xxxdataset1.py\n\t\t|-xxxdataset2.py\n\t\t|-...\n\t|-model\n\t\t|-__init__.py\n\t\t|-model_interface.py\n\t\t|-xxxmodel1.py\n\t\t|-xxxmodel2.py\n\t\t|-...\n\t|-main.py\n\t|-utils.py\n```\n\n## Installation\n\nNo installation is needed. Directly run `git clone https:\u002F\u002Fgithub.com\u002Fmiracleyoo\u002Fpytorch-lightning-template.git` to clone it to your local position. Choose your problem type like `classification`, and copy the corresponding template to your project directory.\n\n## Explanation of Structure\n\n- Thre are only `main.py` and `utils.py` in the root directory. The former is the entrance of the code, and the latter is a support file.\n\n- There is a `__init__.py` file in both `data` and `modle` folder to make them into packages. In this way, the import becomes easier.\n\n- Create a `class DInterface(pl.LightningDataModule):` in `data_interface ` to work as the interface of all different customeized Dataset files. Corresponding Dataset class is imported in the `__init__()` function. Instantiation are done in the `setup()`, and `train_dataloader`, `val_dataloader`, `test_dataloader` functions are created.\n\n- Similarly, class `class MInterface(pl.LightningModule):` are created in `model_interface` to work as the interface of all your model files. Corresponding model class is imported in the `__init__()` function. The only things you need to modify in the interface is the functions like `configure_optimizers`, `training_step`, `validation_step` which control your own training process. One interface for all models, and the difference are handled in args.\n\n- `main.py` is only responsible for the following tasks:\n\n  - Define parser, add parse items. (Attention: If there are some arguments which are supposed to be controled outside, like in the command line, you can directly add a parse item in `main.py` file. For example, there is a string argument called `random_arg`, you can add `parser.add_argument('--random_arg', default='test', type=str)` to the `main.py` file.) Two `Interface` class will automatically select and pass those arguments to the corresponding model\u002Fdata class.\n  - Choose the needed `callback` functions, like auto-save, Early Stop, and LR Scheduler。\n  - Instantiate `MInterface`, `DInterface`, `Trainer`。\n\nFin.\n\n## Attention\n\n**One thing that you need to pay attention to is, in order to let the `MInterface` and `DInterface` be able to parse your newly added models and datasets automatically by simply specify the argument `--model_name` and `--dataset`, we use snake case (like `standard_net.py`) for model\u002Fdataset file, and use the same content with camel case for class name, like `StandardNet`.**\n\nThe same is true for `data` folder.\n\nAlthough this seems restricting your naming of models and datasets, but it can also make your code easier to read and understand. Please pay attention to this point to avoid parsing issues.\n\n## Citation\n\nIf you used this template and find it helpful to your research, please consider citing our paper:\n\n```\n@article{ZHANG2023126388,\ntitle = {Neuromorphic high-frequency 3D dancing pose estimation in dynamic environment},\njournal = {Neurocomputing},\nvolume = {547},\npages = {126388},\nyear = {2023},\nissn = {0925-2312},\ndoi = {https:\u002F\u002Fdoi.org\u002F10.1016\u002Fj.neucom.2023.126388},\nurl = {https:\u002F\u002Fwww.sciencedirect.com\u002Fscience\u002Farticle\u002Fpii\u002FS0925231223005118},\nauthor = {Zhongyang Zhang and Kaidong Chai and Haowen Yu and Ramzi Majaj and Francesca Walsh and Edward Wang and Upal Mahbub and Hava Siegelmann and Donghyun Kim and Tauhidur Rahman},\nkeywords = {Event Camera, Dynamic Vision Sensor, Neuromorphic Camera, Simulator, Dataset, Deep Learning, Human Pose Estimation, 3D Human Pose Estimation, Technology-Mediated Dancing},\n}\n\n@InProceedings{Zhang_2022_WACV,\n    author    = {Zhang, Zhongyang and Xu, Zhiyang and Ahmed, Zia and Salekin, Asif and Rahman, Tauhidur},\n    title     = {Hyperspectral Image Super-Resolution in Arbitrary Input-Output Band Settings},\n    booktitle = {Proceedings of the IEEE\u002FCVF Winter Conference on Applications of Computer Vision (WACV) Workshops},\n    month     = {January},\n    year      = {2022},\n    pages     = {749-759}\n}\n```\n","# PyTorch-Lightning 模板\n\n[**中文版**](.\u002FAssets\u002FREADME_CN.md)\n\n## 简介\n\nPyTorch-Lightning 是一个非常便捷的库，可以看作是对 PyTorch 的抽象和封装。它的优点在于可重用性强、易于维护、逻辑清晰等；缺点则是较为臃肿，需要花费一定时间去学习和理解。此外，由于它直接将模型与训练代码绑定在一起，因此并不适合包含多个模型和数据集文件的真实项目。同样的问题也存在于数据模块的设计中：DataLoader 和自定义 Dataset 之间的强耦合，导致代码在不同地方被不优雅地复制粘贴。\n\n经过多次探索和实践，我总结出了以下模板，这些模板也可以被视为对 PyTorch-Lightning 的进一步抽象。在最初的版本中，所有模板内容都放在根目录下。然而，在使用了一个多月后，我发现针对不同类型项目的更细化模板能够显著提升编码效率。例如，分类任务和超分辨率任务都有一些固定的需求点，通过直接修改专门的模板，可以更快地实现项目代码，并减少一些本可以避免的 bug。\n\n**目前，由于这仍然是一个较新的库，所以只有这两个模板。不过，随着我在其他项目中的应用，未来还会添加更多专门化的模板。如果你已经使用这个模板完成了自己的任务（如 NLP、GAN、语音识别等），欢迎提交 PR，将你的模板整合到库中，以便更多人使用。如果你的任务尚未列入清单，可以从 `classification` 模板开始入手。由于大多数模板的底层逻辑和代码是相同的，因此可以非常快速地完成。**\n\n欢迎大家尝试这套代码风格。一旦习惯之后，复用起来会非常方便，也不容易陷入重复劳动的陷阱。关于 PyTorch-Lightning 的更详细解释和完整指南，请参阅知乎博客中的[这篇文章](https:\u002F\u002Fzhuanlan.zhihu.com\u002Fp\u002F353985363)。\n\n## 文件结构\n\n```\nroot-\n\t|-data\n\t\t|-__init__.py\n\t\t|-data_interface.py\n\t\t|-xxxdataset1.py\n\t\t|-xxxdataset2.py\n\t\t|-...\n\t|-model\n\t\t|-__init__.py\n\t\t|-model_interface.py\n\t\t|-xxxmodel1.py\n\t\t|-xxxmodel2.py\n\t\t|-...\n\t|-main.py\n\t|-utils.py\n```\n\n## 安装\n\n无需安装。直接运行 `git clone https:\u002F\u002Fgithub.com\u002Fmiracleyoo\u002Fpytorch-lightning-template.git` 将其克隆到本地。根据你的问题类型选择如 `classification` 等模板，并将其复制到你的项目目录中。\n\n## 结构说明\n\n- 根目录下仅有 `main.py` 和 `utils.py`。前者是代码的入口，后者则是一些辅助文件。\n- 在 `data` 和 `model` 文件夹中都包含一个 `__init__.py` 文件，用于将它们转换为包，从而简化导入操作。\n- 在 `data_interface` 中创建一个 `class DInterface(pl.LightningDataModule):` 类，作为所有自定义 Dataset 文件的接口。相应的 Dataset 类会在 `__init__()` 函数中被导入。实例化工作在 `setup()` 方法中完成，并定义了 `train_dataloader`、`val_dataloader` 和 `test_dataloader` 方法。\n- 同样地，在 `model_interface` 中创建一个 `class MInterface(pl.LightningModule):` 类，作为所有模型文件的接口。对应的模型类也会在 `__init__()` 函数中被导入。你只需要在接口中修改控制训练过程的函数，如 `configure_optimizers`、`training_step` 和 `validation_step`。一个接口适用于所有模型，差异部分则通过参数来处理。\n- `main.py` 只负责以下任务：\n  - 定义解析器，添加解析项。（注意：如果有某些参数需要在外部控制，比如通过命令行输入，可以直接在 `main.py` 文件中添加解析项。例如，有一个名为 `random_arg` 的字符串参数，可以在 `main.py` 中添加 `parser.add_argument('--random_arg', default='test', type=str)`。两个 `Interface` 类会自动选择并将这些参数传递给相应的模型或数据类。）\n  - 选择所需的回调函数，如自动保存、早停和学习率调度器。\n  - 实例化 `MInterface`、`DInterface` 和 `Trainer`。\n\n完毕。\n\n## 注意事项\n\n**需要注意的一点是，为了让 `MInterface` 和 `DInterface` 能够通过简单指定 `--model_name` 和 `--dataset` 参数，自动解析你新添加的模型和数据集，我们对模型\u002F数据集文件采用蛇形命名法（如 `standard_net.py`），而类名则采用驼峰命名法（如 `StandardNet`）。**\n\n`data` 文件夹也同样遵循这一规则。\n\n虽然这看似限制了你对模型和数据集的命名，但这样做也能使代码更易读、易理解。请务必注意这一点，以避免解析时出现问题。\n\n## 引用\n\n如果你使用了本模板并发现它对你的研究有所帮助，请考虑引用我们的论文：\n\n```\n@article{ZHANG2023126388,\ntitle = {Neuromorphic high-frequency 3D dancing pose estimation in dynamic environment},\njournal = {Neurocomputing},\nvolume = {547},\npages = {126388},\nyear = {2023},\nissn = {0925-2312},\ndoi = {https:\u002F\u002Fdoi.org\u002F10.1016\u002Fj.neucom.2023.126388},\nurl = {https:\u002F\u002Fwww.sciencedirect.com\u002Fscience\u002Farticle\u002Fpii\u002FS0925231223005118},\nauthor = {Zhongyang Zhang and Kaidong Chai and Haowen Yu and Ramzi Majaj and Francesca Walsh and Edward Wang and Upal Mahbub and Hava Siegelmann and Donghyun Kim and Tauhidur Rahman},\nkeywords = {Event Camera, Dynamic Vision Sensor, Neuromorphic Camera, Simulator, Dataset, Deep Learning, Human Pose Estimation, 3D Human Pose Estimation, Technology-Mediated Dancing},\n}\n\n@InProceedings{Zhang_2022_WACV,\n    author    = {Zhang, Zhongyang and Xu, Zhiyang and Ahmed, Zia and Salekin, Asif and Rahman, Tauhidur},\n    title     = {Hyperspectral Image Super-Resolution in Arbitrary Input-Output Band Settings},\n    booktitle = {Proceedings of the IEEE\u002FCVF Winter Conference on Applications of Computer Vision (WACV) Workshops},\n    month     = {January},\n    year      = {2022},\n    pages     = {749-759}\n}\n```","# PyTorch-Lightning-Template 快速上手指南\n\n## 环境准备\n\n在开始之前，请确保您的开发环境满足以下要求：\n\n*   **操作系统**：Linux, macOS 或 Windows\n*   **Python 版本**：建议 Python 3.8 及以上\n*   **前置依赖**：\n    *   PyTorch\n    *   PyTorch Lightning (`pytorch-lightning`)\n    *   其他常规深度学习库（如 `numpy`, `tqdm` 等）\n\n> **提示**：本项目本身无需通过 `pip` 安装，它是一个代码模板库。请确保已安装好 PyTorch 和 PyTorch Lightning 基础环境。国内用户可使用清华源加速安装基础依赖：\n> ```bash\n> pip install torch torchvision torchaudio pytorch-lightning -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n> ```\n\n## 安装步骤\n\n本项目采用克隆源码并复制模板的方式使用，具体步骤如下：\n\n1.  **克隆仓库**\n    将项目克隆到本地任意位置：\n    ```bash\n    git clone https:\u002F\u002Fgithub.com\u002Fmiracleyoo\u002Fpytorch-lightning-template.git\n    ```\n    > **国内加速**：如果 GitHub 访问缓慢，可使用国内镜像（如 Gitee 镜像，若有）或通过代理加速克隆。\n\n2.  **选择并复制模板**\n    进入克隆后的目录，根据您的任务类型（例如 `classification` 分类任务），将对应的模板文件夹复制到您的新项目目录中。\n    \n    假设您要创建一个分类项目：\n    ```bash\n    # 进入模板库根目录\n    cd pytorch-lightning-template\n    \n    # 将 classification 模板复制到您的新项目文件夹 (例如 my_project)\n    cp -r templates\u002Fclassification ..\u002Fmy_project\n    \n    # 或者手动复制您需要的特定模板文件结构\n    ```\n    *注：根据当前版本，主要提供 `classification`（分类）和 `super-resolution`（超分）等专用模板。若您的任务不在列表中，建议从 `classification` 模板开始修改。*\n\n## 基本使用\n\n复制模板后，您的项目结构应包含 `data\u002F`, `model\u002F`, `main.py` 和 `utils.py`。以下是快速启动流程：\n\n### 1. 理解核心结构\n*   **`main.py`**：程序入口。负责解析命令行参数、配置回调函数（如自动保存、早停、学习率调度）以及实例化 `Trainer`。\n*   **`data\u002F`**：数据模块。\n    *   `data_interface.py`：定义 `DInterface` 类，统一处理 `DataLoader` 的构建。\n    *   `xxxdataset.py`：具体的 Dataset 实现文件。\n*   **`model\u002F`**：模型模块。\n    *   `model_interface.py`：定义 `MInterface` 类，统一处理训练步 (`training_step`)、验证步及优化器配置。\n    *   `xxxmodel.py`：具体的网络模型实现文件。\n\n### 2. 命名规范（重要）\n为了让 `main.py` 自动识别并加载您新增的模型或数据集，**必须严格遵守以下命名规则**：\n*   **文件名**：使用蛇形命名法（snake_case），例如 `standard_net.py`。\n*   **类名**：使用驼峰命名法（CamelCase），且内容需与文件名对应，例如 `StandardNet`。\n*   **调用方式**：运行时通过 `--model_name standard_net` 和 `--dataset xxxdataset` 参数自动匹配。\n\n### 3. 运行示例\n假设您已经在 `model\u002F` 下添加了 `my_model.py` (类名 `MyModel`)，在 `data\u002F` 下添加了 `my_data.py` (类名 `MyData`)。\n\n在项目根目录执行：\n\n```bash\npython main.py --model_name my_model --dataset my_data --gpus 1 --max_epochs 50\n```\n\n**自定义参数扩展**：\n如果需要传递额外参数（如随机种子或特定超参），可直接在 `main.py` 的 `parser` 部分添加：\n```python\n# 在 main.py 中\nparser.add_argument('--random_arg', default='test', type=str)\n```\n该参数会自动透传给对应的 Model 或 Data 接口类。\n\n### 4. 开发新任务\n*   **新增模型**：在 `model\u002F` 目录下新建 `.py` 文件，继承 `pl.LightningModule` 实现网络结构，并在 `model_interface.py` 中按需调整逻辑（通常只需关注 `configure_optimizers` 等核心训练流程）。\n*   **新增数据**：在 `data\u002F` 目录下新建 `.py` 文件，继承 `torch.utils.data.Dataset`，并在 `data_interface.py` 的 `setup()` 中完成实例化。\n\n通过以上步骤，您可以基于此模板快速搭建结构清晰、易于维护的 PyTorch Lightning 项目。","某计算机视觉团队正在同时研发图像分类与超分辨率两个模型，急需统一训练框架以提升迭代效率。\n\n### 没有 pytorch-lightning-template 时\n- **代码重复严重**：每个新任务都要手动重写 DataLoader 配置和训练循环逻辑，导致大量样板代码在不同项目间复制粘贴。\n- **耦合度过高**：PyTorch Lightning 原生设计将模型与数据强绑定，难以在同一工程中灵活切换多个数据集或模型架构。\n- **维护成本高昂**：缺乏标准化的接口定义，修改优化器策略或验证流程时，需逐个文件排查，极易引入隐蔽 Bug。\n- **迁移门槛高**：将旧版纯 PyTorch 代码重构为 Lightning 风格耗时费力，团队成员需花费大量时间学习其重型抽象机制。\n\n### 使用 pytorch-lightning-template 后\n- **模板化开发**：直接复用分类或超分辨率专用模板，仅需修改少量参数即可启动新任务，彻底消除重复编码。\n- **解耦架构清晰**：通过 `data_interface` 和 `model_interface` 统一入口，轻松实现多模型、多数据集的自由组合与切换。\n- **逻辑集中管控**：训练步骤、验证逻辑及优化器配置集中在接口层管理，变更一处即可全局生效，显著降低维护难度。\n- **平滑迁移路径**：保留原有 PyTorch 代码自由度，只需稍作适配即可接入 Lightning 生态，无需重写配置文件或颠覆现有习惯。\n\npytorch-lightning-template 通过标准化接口与场景化模板，让复杂的多模型项目管理变得像搭积木一样简单高效。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmiracleyoo_pytorch-lightning-template_df789616.png","miracleyoo","Miracleyoo","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fmiracleyoo_1636e628.jpg","A Ph.D. student who mainly focus on machine learning, and sometimes create some interesting gadget。","University of California San Diego","San Diego, USA","mirakuruyoo@gmail.com",null,"miracleyoo.com","https:\u002F\u002Fgithub.com\u002Fmiracleyoo",[83,87,91],{"name":84,"color":85,"percentage":86},"Jupyter Notebook","#DA5B0B",83.9,{"name":88,"color":89,"percentage":90},"Python","#3572A5",16,{"name":92,"color":93,"percentage":94},"Shell","#89e051",0,1538,190,"2026-04-10T23:05:24","Apache-2.0","","未说明",{"notes":102,"python":100,"dependencies":103},"该工具无需安装，直接克隆仓库后复制对应任务模板（如分类、超分辨率）到项目目录即可使用。命名需遵循特定规范：文件名使用蛇形命名法（如 standard_net.py），类名使用驼峰命名法（如 StandardNet），以便接口自动解析模型和数据集。",[104],"pytorch-lightning",[14],[107,104,64,108,109,110,111],"pytorch","best-practices","config","deep-learning","template","2026-03-27T02:49:30.150509","2026-04-11T20:34:35.722010",[115,120,125,130],{"id":116,"question_zh":117,"answer_zh":118,"source_url":119},29787,"PyTorch Lightning 新版本（>1.8.5）中哪些超参数已被弃用，如何修复？","在 PyTorch Lightning 新版本中，`args.resume_from_checkpoint` 已被弃用。加载训练好的模型时，应改用 `args.ckpt_path = load_path`。如果您发现模板中有其他弃用的函数，欢迎提交 PR 进行修复。","https:\u002F\u002Fgithub.com\u002Fmiracleyoo\u002Fpytorch-lightning-template\u002Fissues\u002F6",{"id":121,"question_zh":122,"answer_zh":123,"source_url":124},29788,"遇到报错 'RuntimeError: Please only pass an ArgumentParser instance' 该如何解决？","该错误通常是因为参数解析器配置顺序或方式不当。请确保先创建参数组，再添加 Trainer 的参数。具体代码修改如下：\n1. 使用 `parser.add_argument_group(title=\"pl.Trainer args\")` 创建参数组。\n2. 接着调用 `parser = Trainer.add_argparse_args(parser)`。\n按此顺序调整后即可解决问题。","https:\u002F\u002Fgithub.com\u002Fmiracleyoo\u002Fpytorch-lightning-template\u002Fissues\u002F4",{"id":126,"question_zh":127,"answer_zh":128,"source_url":129},29789,"模板中的验证集和测试集设置是否相同？如果没有独立测试集该如何处理？","是的，在该模板默认设置中，验证集和测试集的内容是一样的。这是因为并非所有任务都有独立的测试集，为了方便开发做了此设置。如果您有独立的测试集，可以参考验证集的写法，将相关逻辑修改为您的测试集内容即可。","https:\u002F\u002Fgithub.com\u002Fmiracleyoo\u002Fpytorch-lightning-template\u002Fissues\u002F3",{"id":131,"question_zh":132,"answer_zh":133,"source_url":129},29790,"代码中使用的 `self.train` 变量未定义，它是从哪里继承或获取的？","`self.train` 变量是通过类内部的 `self.__dict__.update(locals())` 这一句代码自动注入的。该行代码会将局部变量（如初始化时传入的 `train` 参数）更新到实例的 `__dict__` 中，从而可以直接通过 `self.train` 访问。",[]]