[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-wenxinxu--resnet-in-tensorflow":3,"tool-wenxinxu--resnet-in-tensorflow":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 真正成长为懂上",153609,2,"2026-04-13T11:34:59",[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":75,"owner_twitter":75,"owner_website":75,"owner_url":78,"languages":79,"stars":84,"forks":85,"last_commit_at":86,"license":87,"difficulty_score":32,"env_os":88,"env_gpu":89,"env_ram":89,"env_deps":90,"category_tags":97,"github_topics":75,"view_count":32,"oss_zip_url":75,"oss_zip_packed_at":75,"status":17,"created_at":98,"updated_at":99,"faqs":100,"releases":130},7240,"wenxinxu\u002Fresnet-in-tensorflow","resnet-in-tensorflow","Re-implement Kaiming He's deep residual networks in tensorflow. Can be trained with cifar10.","resnet-in-tensorflow 是一个基于 TensorFlow 框架开源实现的深度学习项目，旨在复现何恺明提出的经典残差网络（ResNet）及其变体。它主要解决了开发者在尝试理解或应用 ResNet 架构时，面临官方代码复杂、环境配置困难或缺乏直观监控手段的问题，让用户能够快速在 CIFAR-10 数据集上完成模型的训练与验证。\n\n该项目特别适合刚接触深度残差网络的初学者、高校研究人员以及希望快速搭建基准模型的算法工程师。其核心亮点在于极高的易用性与透明度：代码结构清晰简洁，仅由四个核心文件组成，逻辑一目了然；同时内置了完善的可视化支持，不仅能实时输出训练误差，还能生成 TensorBoard 统计图表和网络结构图，帮助用户全方位监控训练过程。此外，项目提供了灵活的超参数配置接口，用户可轻松调整网络层数（如 ResNet-32\u002F56\u002F110）以探索不同模型性能。对于想要深入理解 ResNet 原理并动手实践的用户而言，这是一个友好且高效的学习工具。","# ResNet in Tensorflow\n\nThis implementation of [resnet](http:\u002F\u002Farxiv.org\u002Fabs\u002F1512.03385) and [its variants](https:\u002F\u002Farxiv.org\u002Fabs\u002F1603.05027)  is designed to be straightforward and friendly to new ResNet users. You can train a resnet on cifar10 by downloading and running the code. There are screen outputs, tensorboard statistics and tensorboard graph visualization to help you monitor the training process and visualize the model.\n\nNow the code works with tensorflow 1.0.0 and 1.1.0, but it's no longer compatible with earlier versions.\n\n\n#### If you like the code, please star it! You are welcome to post questions and suggestions on my github.\n\n\n## Table of Contents\n* [Validation errors](#validation-errors)\n* [Training curves](#training-curves)\n* [User's guide](#users-guide)\n   * [Pre-requisites](#pre-requisites)\n   * [Overall structure](#overall-structure)\n   * [Hyper-parameters](#hyper-parameters)\n   * [Resnet Strcuture](#resnet-structure)\n   * [Training](#training)\n   * [Test](#test)\n\n\n## Validation errors\nThe lowest valdiation errors of ResNet-32, ResNet-56 and ResNet-110 are 6.7%, 6.5% and 6.2% respectively. You can change the number of the total layers by changing the hyper-parameter num_residual_blocks. Total layers = 6 * num_residual_blocks + 2\n\nNetwork | Lowest Validation Error\n------- | -----------------------\nResNet-32 | 6.7%\nResNet-56 | 6.5%\nResNet-110 | 6.2%\n\n## Training curves\n![alt tag](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fwenxinxu_resnet-in-tensorflow_readme_2a7feb382e25.png)\n\n## User's guide\nYou can run cifar10_train.py and see how it works from the screen output (the code will download the data for you if you don't have it yet). It’s better to speicify version identifier before running, since the training logs, checkpoints, and error.csv file will be saved in the folder with name logs_$version. You can do this by command line: `python cifar10_train.py --version='test'`. You may also change the version number inside the hyper_parameters.py file\n\nThe training and validation error will be output on the screen. They can also be viewed using tensorboard. Use `tensorboard --logdir='logs_$version'` command to pull them out. (For e.g. If the version is ‘test’, the logdir should be ‘logs_test’.) \nThe relevant statistics of each layer can be found on tensorboard.  \n\n### Pre-requisites\npandas, numpy , opencv, tensorflow(1.0.0)\n\n### Overall structure\nThere are four python files in the repository. cifar10_input.py, resnet.py, cifar10_train.py, hyper_parameters.py.\n\ncifar10_input.py includes helper functions to download, extract and pre-process the cifar10 images. \nresnet.py defines the resnet structure.\ncifar10_train.py is responsible for the training and validation.\nhyper_parameters.py defines hyper-parameters related to train, resnet structure, data augmentation, etc. \n\nThe following sections expain the codes in details.\n\n------------------------------------------------------------------------------------------------------------------------------------\n### hyper-parameters\nThe hyper_parameters.py file defines all the hyper-parameters that you may change to customize your training. You may use `python cifar10_train.py --hyper_parameter1=value1 --hyper_parameter2=value2` to set all the hyper-parameters. You may also change the default values inside the python script.\n\nThere are five categories of hyper-parameters.\n\n-------------------------------------------------------------------------------------------------------------------------------------\n#### 1. Hyper-parameters about saving training logs, tensorboard outputs and screen outputs, which includes:\n**version**: str. The checkpoints and output events will be saved in logs_$version\u002F\n\n**report_freq**: int. How many batches to run a full validation and print screen output once. Screen output looks like:\n![alt tag](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fwenxinxu_resnet-in-tensorflow_readme_23b2f3260817.png)\n\n**train_ema_decay**: float. The tensorboard will record a moving average of batch train errors, besides the original ones. This decay factor is used to define an ExponentialMovingAverage object in tensorflow with `tf.train.ExponentialMovingAverage(FLAGS.train_ema_decay, global_step)`. Essentially, the recorded error = train_ema_decay * shadowed_error + (1 - train_ema_decay) * current_batch_error. The larger the train_ema_decay is, the smoother the training curve will be.\n\n-------------------------------------------------------------------------------------------------------------------------------------\n\n\n#### 2. Hyper-parameters regarding the training process\n**train_steps**: int. Total training steps \n\n**is_full_validation**: boolean. If you want to use all the 10000 validation images to run the validation (True), or you want to randomly draw a batch of validation data (False)\n\n**train_batch_size**: int. Training batch size\n\n**validation_batch_size**: int. Validation batch size (which is only effective if is_full_validation=False)\n\n**init_lr**: float. The initial learning rate. The learning rate may decay based on the settings below\n\n**lr_decay_factor**: float. The decaying factor of learning rate. The learning rate will become lr_decay_factor * current_learning_rate every time it is decayed. \n\n**decay_step0**: int. The learning rate will decay at decay_step0 for the first time\n\n**decay_step1**: int. The second time when the learning rate will decay\n\n------------------------------------------------------------------------------------------------------------------------------------\n\n#### 3. Hyper-parameters that controls the network\n**num_residual_blocks**: int. The total layers of the ResNet = 6 * num_residual_blocks + 2\n\n**weight_decay**: float. The weight decay used to regularize the network. Total_loss = train_loss + weight_decay* sume of sqaures of the weights\n\n-----------------------------------------------------------------------------------------------------------------------------------\n\n#### 4. About data augmentation\n**padding_size**: int. padding_size is numbers of zero pads to add on each side of the image. Padding and random cropping during training can prevent overfitting. \n\n-----------------------------------------------------------------------------------------------------------------------------------\n\n#### 5. Loading checkpoints\n**ckpt_path**: str. The path of the checkpoint that you want to load\n\n**is_use_ckpt**: boolean. If yes,  use a checkpoint and continue the training from the checkpoint\n\n-----------------------------------------------------------------------------------------------------------------------------------\n\n\n### ResNet Structure\nHere we use the latest version of ResNet. The structure of the residual block looks like [ref](https:\u002F\u002Farxiv.org\u002Fabs\u002F1603.05027):\n\u003Cp align=\"center\">\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fwenxinxu_resnet-in-tensorflow_readme_13c04b94d6e8.png\" width=\"240\">\n\u003C\u002Fp>\n\nThe inference() function is the main function of resnet.py. It will be used twice in both building the training graph and validation graph. \n\u003C!--The inference() function is the main function of resnet.py. It takes three arguments: input_tensor_batch, n and resue. input_tensor_batch is a 4D tensor with shape of [batch_size, img_height, img_width, img_depth]. n is the num_residual_blocks. Reuse is a boolean, indicating the graph is build for train or validation data.\n\nTo enable the different sizes of validation batch to train batch, I use two different sets of placeholders for train and validation data, and build the graphs separately, and the validation graph shares the same weights with the train graph. In this situation, we are passing reuse=True to each variable scope of train graph to fetch the weights. To read more about variable scope, see [variable scope](https:\u002F\u002Fwww.tensorflow.org\u002Fversions\u002Fmaster\u002Fhow_tos\u002Fvariable_scope\u002Findex.html) -->\n\n\n### Training\nThe class Train() defines all the functions regarding training process, with train() being the main function. The basic idea is to run train_op for FLAGS.train_steps times. If step % FLAGS.report_freq == 0, it will valdiate once, train once and wrote all the summaries onto the tensorboard. \n \n\u003C!--(We do want to validate before training, so that we can check the original errors and losses with the theoretical value.)-->\n\n\u003C!--The following two concepts may help you understand the code better.\n\n####1. Placeholder\nPlaceholders can be viewed as tensors that must be fed with real data on every execution. If you want to change the \"values\" of certain tensors on each step of training, placeholders are the most straightforward way. For example, we train the model with different batches of data on each step by feeding different batches of numpy array into the image_placeholder and label_placeholder. A feed dict looks like:\n```\nfeed_dict = {self.image_placeholder: train_batch_data,\n             self.label_placeholder: train_batch_labels,\n             self.vali_image_placeholder: validation_batch_data,\n             self.vali_label_placeholder: validation_batch_labels,\n             self.lr_placeholder: FLAGS.init_lr}\n```             \nFor more detailed explaination, see [tf.placeholder()](https:\u002F\u002Fwww.tensorflow.org\u002Fapi_docs\u002Fpython\u002Fio_ops\u002Fplaceholders#placeholder) and [feeding data](https:\u002F\u002Fwww.tensorflow.org\u002Fhow_tos\u002Freading_data\u002F#feeding)\n\n####2. Summary\nTensorboard is a very useful tool to supervise and visualize the training process. Here I provide a step-by-step guide on how to set up tensorboard.\n\n**a) Summarize the tensors of interest**\nAfter you create the tensor, add `tf.scalar_summary(name='name_on_tensorboard', tensor=tensor)`. [This summary](https:\u002F\u002Fwww.tensorflow.org\u002Fapi_docs\u002Fpython\u002Fsummary\u002Fgeneration_of_summaries_#scalar) is essentially an operation. It won't do anything until you run it in a session!\n\n**b) Merge all summaries**\nAfter you set up all the scalar summaries, type `summary_op = tf.merge_all_summaries()`. This command merge all the summarizing operations into a single operation, which means that running summary_op is equivalent to running all the scalar summaries together. -->\n\n### Test\nThe test() function in the class Train() help you predict. It returns the softmax probability with shape [num_test_images, num_labels]. You need to prepare and pre-process your test data and pass it to the function. You may either use your own checkpoints or the pre-trained ResNet-110 checkpoint I uploaded. You may wrote the following lines at the end of cifar10_train.py file\n```\ntrain = Train()\ntest_image_array = ... # Better to be whitened in advance. Shape = [-1, img_height, img_width, img_depth]\npredictions = train.test(test_image_array)\n# predictions is the predicted softmax array.\n```\nRun the following commands in the command line:\n```\n# If you want to use my checkpoint. \npython cifar10_train.py --test_ckpt_path='model_110.ckpt-79999'\n```\n   \n","# TensorFlow 中的 ResNet\n\n本实现基于 [ResNet](http:\u002F\u002Farxiv.org\u002Fabs\u002F1512.03385) 及其 [变体](https:\u002F\u002Farxiv.org\u002Fabs\u002F1603.05027)，旨在为新用户打造一个简单易用的入门工具。您只需下载并运行代码，即可在 CIFAR-10 数据集上训练 ResNet 模型。训练过程中会提供终端输出、TensorBoard 统计信息以及模型结构图可视化，帮助您监控训练进度并直观理解模型。\n\n目前该代码支持 TensorFlow 1.0.0 和 1.1.0 版本，但不再兼容更早的版本。\n\n\n#### 如果您喜欢这份代码，请为它点个赞！欢迎在我的 GitHub 上提出问题和建议。\n\n\n## 目录\n* [验证误差](#validation-errors)\n* [训练曲线](#training-curves)\n* [用户指南](#users-guide)\n   * [前置条件](#pre-requisites)\n   * [整体结构](#overall-structure)\n   * [超参数](#hyper-parameters)\n   * [ResNet 结构](#resnet-structure)\n   * [训练](#training)\n   * [测试](#test)\n\n\n## 验证误差\nResNet-32、ResNet-56 和 ResNet-110 的最低验证误差分别为 6.7%、6.5% 和 6.2%。您可以通过调整超参数 `num_residual_blocks` 来改变总层数：总层数 = 6 × `num_residual_blocks` + 2。\n\n网络 | 最低验证误差\n------- | -----------------------\nResNet-32 | 6.7%\nResNet-56 | 6.5%\nResNet-110 | 6.2%\n\n## 训练曲线\n![alt tag](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fwenxinxu_resnet-in-tensorflow_readme_2a7feb382e25.png)\n\n## 用户指南\n您可以运行 `cifar10_train.py`，通过终端输出了解其工作流程（如果尚未下载数据，代码会自动为您完成）。建议在运行前指定版本标识符，因为训练日志、检查点和 `error.csv` 文件都将保存在名为 `logs_$version` 的文件夹中。您可以通过命令行设置版本号：`python cifar10_train.py --version='test'`。此外，也可以直接修改 `hyper_parameters.py` 文件中的版本号。\n\n训练和验证误差会实时打印在终端上，同时也可以通过 TensorBoard 查看。使用命令 `tensorboard --logdir='logs_$version'` 即可启动 TensorBoard。（例如，若版本为 ‘test’，则 logdir 应为 ‘logs_test’。）TensorBoard 还能展示各层的相关统计信息。\n\n### 前置条件\npandas、numpy、opencv、tensorflow (1.0.0)\n\n### 整体结构\n仓库中包含四个 Python 文件：`cifar10_input.py`、`resnet.py`、`cifar10_train.py` 和 `hyper_parameters.py`。\n\n`cifar10_input.py` 包含用于下载、解压和预处理 CIFAR-10 图像的辅助函数。  \n`resnet.py` 定义了 ResNet 的网络结构。  \n`cifar10_train.py` 负责模型的训练与验证。  \n`hyper_parameters.py` 则定义了与训练、ResNet 结构、数据增强等相关的超参数。\n\n以下章节将详细解释这些代码。\n\n------------------------------------------------------------------------------------------------------------------------------------\n### 超参数\n`hyper_parameters.py` 文件定义了所有可供修改的超参数，以便您自定义训练过程。您可以通过 `python cifar10_train.py --hyper_parameter1=value1 --hyper_parameter2=value2` 来设置超参数，也可以直接在脚本中更改默认值。\n\n超参数主要分为五大类。\n\n-------------------------------------------------------------------------------------------------------------------------------------\n#### 1. 关于保存训练日志、TensorBoard 输出及终端输出的超参数，包括：\n**version**: 字符串。检查点和输出事件将保存在 `logs_$version\u002F` 文件夹中。\n\n**report_freq**: 整数。每经过多少个批次执行一次完整验证并打印终端输出。终端输出示例如下：\n![alt tag](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fwenxinxu_resnet-in-tensorflow_readme_23b2f3260817.png)\n\n**train_ema_decay**: 浮点数。TensorBoard 不仅会记录原始批次训练误差，还会记录其移动平均值。此衰减因子用于在 TensorFlow 中创建指数移动平均对象：`tf.train.ExponentialMovingAverage(FLAGS.train_ema_decay, global_step)`。计算公式为：记录误差 = `train_ema_decay` × 影子误差 + (1 - `train_ema_decay`) × 当前批次误差。`train_ema_decay` 值越大，训练曲线越平滑。\n\n-------------------------------------------------------------------------------------------------------------------------------------\n\n\n#### 2. 与训练过程相关的超参数\n**train_steps**: 整数。总训练步数。\n\n**is_full_validation**: 布尔值。是否使用全部 10000 张验证图像进行验证（True），或随机抽取一批验证数据进行验证（False）。\n\n**train_batch_size**: 整数。训练批次大小。\n\n**validation_batch_size**: 整数。验证批次大小（仅当 `is_full_validation=False` 时有效）。\n\n**init_lr**: 浮点数。初始学习率。学习率可根据以下设置逐步衰减。\n\n**lr_decay_factor**: 浮点数。学习率衰减因子。每次衰减后，学习率将变为当前学习率的 `lr_decay_factor` 倍。\n\n**decay_step0**: 整数。学习率首次衰减的步数。\n\n**decay_step1**: 整数。学习率第二次衰减的步数。\n\n------------------------------------------------------------------------------------------------------------------------------------\n\n#### 3. 控制网络结构的超参数\n**num_residual_blocks**: 整数。ResNet 的总层数 = 6 × `num_residual_blocks` + 2。\n\n**weight_decay**: 浮点数。用于正则化网络的权重衰减系数。总损失 = 训练损失 + `weight_decay` × 权重平方和。\n\n-----------------------------------------------------------------------------------------------------------------------------------\n\n#### 4. 数据增强相关\n**padding_size**: 整数。表示在图像每侧填充的零值像素数量。训练期间的填充和随机裁剪有助于防止过拟合。\n\n-----------------------------------------------------------------------------------------------------------------------------------\n\n#### 5. 加载检查点\n**ckpt_path**: 字符串。要加载的检查点路径。\n\n**is_use_ckpt**: 布尔值。若为 True，则从检查点继续训练。\n\n-----------------------------------------------------------------------------------------------------------------------------------\n\n### ResNet 结构\n这里我们使用最新版本的 ResNet。残差块的结构如下所示[ref](https:\u002F\u002Farxiv.org\u002Fabs\u002F1603.05027)：\n\u003Cp align=\"center\">\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fwenxinxu_resnet-in-tensorflow_readme_13c04b94d6e8.png\" width=\"240\">\n\u003C\u002Fp>\n\ninference() 函数是 resnet.py 中的主要函数。它将在构建训练图和验证图时分别被调用两次。\n\u003C!--inference() 函数是 resnet.py 中的主要函数。它接受三个参数：input_tensor_batch、n 和 reuse。input_tensor_batch 是一个 4D 张量，形状为 [batch_size, img_height, img_width, img_depth]。n 是残差块的数量。reuse 是一个布尔值，用于指示图是为训练数据还是验证数据构建的。\n\n为了支持不同大小的验证批次与训练批次，我为训练数据和验证数据使用了两组不同的占位符，并分别构建图。验证图与训练图共享相同的权重。在这种情况下，我们会将 reuse=True 传递给训练图中的每个变量作用域，以获取这些权重。有关变量作用域的更多信息，请参阅 [variable scope](https:\u002F\u002Fwww.tensorflow.org\u002Fversions\u002Fmaster\u002Fhow_tos\u002Fvariable_scope\u002Findex.html) -->\n\n\n### 训练\nTrain() 类定义了与训练过程相关的所有函数，其中 train() 是主函数。基本思路是运行 train_op FLAGS.train_steps 次。如果 step % FLAGS.report_freq == 0，则会进行一次验证、一次训练，并将所有摘要写入 TensorBoard。\n\n\u003C!--（我们确实希望在训练之前先进行验证，这样可以将初始误差和损失与理论值进行对比。）-->\n\n\u003C!--以下两个概念可能有助于更好地理解代码。\n\n####1. 占位符\n占位符可以被视为在每次执行时必须填充真实数据的张量。如果你想在每一步训练中改变某些张量的“值”，占位符是最直接的方式。例如，我们通过在每一步训练中向 image_placeholder 和 label_placeholder 喂入不同的批次的 NumPy 数组来训练模型。一个 feed dict 看起来如下：\n```\nfeed_dict = {self.image_placeholder: train_batch_data,\n             self.label_placeholder: train_batch_labels,\n             self.vali_image_placeholder: validation_batch_data,\n             self.vali_label_placeholder: validation_batch_labels,\n             self.lr_placeholder: FLAGS.init_lr}\n```             \n更多详细说明，请参阅 [tf.placeholder()](https:\u002F\u002Fwww.tensorflow.org\u002Fapi_docs\u002Fpython\u002Fio_ops\u002Fplaceholders#placeholder) 和 [feeding data](https:\u002F\u002Fwww.tensorflow.org\u002Fhow_tos\u002Freading_data\u002F#feeding)\n\n####2. 摘要\nTensorBoard 是一种非常有用的工具，可用于监控和可视化训练过程。下面提供一个关于如何设置 TensorBoard 的分步指南。\n\n**a) 对感兴趣的张量进行摘要**\n创建张量后，添加 `tf.scalar_summary(name='name_on_tensorboard', tensor=tensor)`。[这种摘要](https:\u002F\u002Fwww.tensorflow.org\u002Fapi_docs\u002Fpython\u002Fsummary\u002Fgeneration_of_summaries_#scalar)本质上是一个操作。只有在会话中运行它时，它才会生效！\n\n**b) 合并所有摘要**\n设置好所有标量摘要后，输入 `summary_op = tf.merge_all_summaries()`。该命令会将所有摘要操作合并为一个单一的操作，这意味着运行 summary_op 就相当于同时运行所有的标量摘要。--> \n\n### 测试\nTrain() 类中的 test() 函数用于进行预测。它返回一个形状为 [num_test_images, num_labels] 的 softmax 概率矩阵。你需要准备好并预处理测试数据，然后将其传递给该函数。你可以使用自己的检查点，也可以使用我上传的预训练 ResNet-110 检查点。你可以在 cifar10_train.py 文件末尾添加以下代码：\n```\ntrain = Train()\ntest_image_array = ... # 最好提前进行白化处理。形状为 [-1, img_height, img_width, img_depth]\npredictions = train.test(test_image_array)\n# predictions 是预测得到的 softmax 数组。\n```\n然后在命令行中运行以下命令：\n```\n# 如果你想使用我的检查点。\npython cifar10_train.py --test_ckpt_path='model_110.ckpt-79999'\n```","# ResNet in TensorFlow 快速上手指南\n\n本指南基于 `resnet-in-tensorflow` 项目，帮助开发者快速在 CIFAR-10 数据集上训练和评估 ResNet 模型。\n\n## 环境准备\n\n### 系统要求\n- **Python**: 兼容 Python 2.7 或 3.x（取决于具体 TensorFlow 版本环境）\n- **TensorFlow**: 必须使用 **1.0.0** 或 **1.1.0** 版本（不兼容更早版本）\n\n### 前置依赖\n请确保安装以下 Python 库：\n- `tensorflow` (1.0.0 或 1.1.0)\n- `pandas`\n- `numpy`\n- `opencv` (通常通过 `opencv-python` 安装)\n\n> **国内加速建议**：推荐使用清华源或阿里源安装依赖，以提升下载速度。\n> ```bash\n> pip install -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple tensorflow==1.1.0 pandas numpy opencv-python\n> ```\n\n## 安装步骤\n\n1. **克隆仓库**\n   将代码下载到本地：\n   ```bash\n   git clone https:\u002F\u002Fgithub.com\u002Fwenxinxu\u002Fresnet-in-tensorflow.git\n   cd resnet-in-tensorflow\n   ```\n\n2. **验证文件结构**\n   确保目录下包含以下四个核心文件：\n   - `cifar10_input.py`: 数据下载与预处理\n   - `resnet.py`: ResNet 网络结构定义\n   - `cifar10_train.py`: 训练与验证主脚本\n   - `hyper_parameters.py`: 超参数配置\n\n## 基本使用\n\n### 1. 开始训练\n运行训练脚本会自动下载 CIFAR-10 数据集（如果本地不存在）。建议指定 `version` 参数，以便将日志、检查点和错误记录保存到独立文件夹（如 `logs_test`）。\n\n```bash\npython cifar10_train.py --version='test'\n```\n\n**说明：**\n- 屏幕将实时输出训练和验证误差。\n- 可通过修改 `hyper_parameters.py` 或使用命令行参数（如 `--num_residual_blocks=9`）调整网络深度和学习率等超参数。\n- 默认网络层数计算公式：`Total layers = 6 * num_residual_blocks + 2`。\n\n### 2. 可视化监控 (TensorBoard)\n使用 TensorBoard 查看训练曲线、统计信息及计算图。\n\n```bash\ntensorboard --logdir='logs_test'\n```\n*注：请将 `logs_test` 替换为你实际设置的 `--version` 名称。然后在浏览器中访问显示的地址（通常为 http:\u002F\u002Flocalhost:6006）。*\n\n### 3. 模型测试与预测\n你可以使用训练好的检查点（checkpoint）对新数据进行预测。项目提供了预训练的 ResNet-110 模型，也可使用自己训练的模型。\n\n在 `cifar10_train.py` 末尾添加以下逻辑或直接通过命令行加载检查点进行推理：\n\n```bash\n# 使用预训练的 ResNet-110 检查点\npython cifar10_train.py --test_ckpt_path='model_110.ckpt-79999'\n```\n\n**代码集成示例：**\n若需在代码中调用测试功能：\n```python\ntrain = Train()\n# 准备测试数据数组，形状应为 [-1, img_height, img_width, img_depth]，建议预先进行白化处理\ntest_image_array = ... \npredictions = train.test(test_image_array)\n# predictions 为 softmax 概率数组\n```\n\n### 性能参考\n在 CIFAR-10 数据集上的最低验证误差参考：\n- **ResNet-32**: 6.7%\n- **ResNet-56**: 6.5%\n- **ResNet-110**: 6.2%","某高校计算机视觉实验室的研究生团队正致力于复现经典残差网络（ResNet）论文，以在 CIFAR-10 数据集上验证不同深度模型的分类性能。\n\n### 没有 resnet-in-tensorflow 时\n- **复现门槛高**：团队成员需从零开始编写复杂的残差块连接逻辑，极易因代码错误导致梯度消失，难以还原论文中的网络结构。\n- **调试过程黑盒**：缺乏内置的可视化支持，训练过程中的损失变化和各层统计信息只能靠打印日志猜测，难以定位模型不收敛的原因。\n- **实验管理混乱**：每次调整超参数（如残差块数量）都需要手动修改代码并重新整理保存路径，导致多组实验的日志、检查点和误差数据混杂难辨。\n- **环境兼容性问题**：自行搭建的代码往往对 TensorFlow 版本敏感，频繁遭遇版本冲突报错，浪费大量时间在环境配置而非算法研究上。\n\n### 使用 resnet-in-tensorflow 后\n- **开箱即用**：直接调用预定义的 `resnet.py` 模块，仅需调整 `num_residual_blocks` 参数即可快速构建 ResNet-32\u002F56\u002F110，完美复现论文架构。\n- **监控透明化**：利用集成的 TensorBoard 功能，实时查看训练曲线、验证误差及每层的详细统计图表，直观掌握模型学习状态。\n- **实验规范化**：通过命令行指定 `--version` 参数，自动将不同实验的训练日志、模型断点和误差 CSV 隔离存储在不同文件夹，管理井然有序。\n- **版本适配稳定**：代码专为 TensorFlow 1.0+ 优化，消除了底层兼容性隐患，让团队能专注于超参数调优和结果分析。\n\nresnet-in-tensorflow 将繁琐的底层实现转化为标准化的实验流程，显著降低了深度学习新手的入门成本并提升了科研迭代效率。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fwenxinxu_resnet-in-tensorflow_6bf3f510.png","wenxinxu","Alexia Xu","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fwenxinxu_4bd0bd88.jpg",null,"Stanford University","United States","https:\u002F\u002Fgithub.com\u002Fwenxinxu",[80],{"name":81,"color":82,"percentage":83},"Python","#3572A5",100,828,276,"2025-12-31T02:52:49","MIT","","未说明",{"notes":91,"python":89,"dependencies":92},"该工具仅兼容 TensorFlow 1.0.0 和 1.1.0 版本，不支持更早或更新的版本。运行前需确保安装 pandas、numpy、opencv 及指定版本的 tensorflow。代码会自动下载 CIFAR-10 数据集（若本地不存在）。建议使用命令行参数 --version 指定日志文件夹名称以区分不同实验。",[93,94,95,96],"tensorflow==1.0.0 或 1.1.0","pandas","numpy","opencv",[15,14],"2026-03-27T02:49:30.150509","2026-04-14T04:42:46.135999",[101,106,111,116,121,125],{"id":102,"question_zh":103,"answer_zh":104,"source_url":105},32501,"如何在自定义数据集（非 CIFAR-10）上训练模型，例如修改图像尺寸和分类类别数？","若要使用自定义数据集（如 256x256 图像，4 个分类），需要修改代码中的硬编码参数。具体步骤：\n1. 首先将图像调整为网络输入所需的尺寸（如 32x32），或者修改网络结构以适配大尺寸图像。\n2. 修改分类数量：在 `resnet.py` 第 195 行和 `cifar10_input.py` 第 21 行修改类别数（原为 10）。\n3. 注意：直接缩放图像可能会损失特征，效果可能不如针对 ImageNet 优化的 ResNet，但可以作为起点尝试。","https:\u002F\u002Fgithub.com\u002Fwenxinxu\u002Fresnet-in-tensorflow\u002Fissues\u002F2",{"id":107,"question_zh":108,"answer_zh":109,"source_url":110},32502,"运行训练时出现文件读取错误或路径问题，如何解决？","如果运行 `.\u002Fcifar10_train.py` 出现文件读取错误，通常是因为工作目录设置导致数据集下载路径不正确。解决方法是切换工作目录后直接使用 python 命令运行：\n`python cifar10_train.py`\n这样 `maybe_download_and_extract()` 函数会将数据集下载到正确的目录中。另外，请检查下载的 CIFAR-10 文件是否损坏。","https:\u002F\u002Fgithub.com\u002Fwenxinxu\u002Fresnet-in-tensorflow\u002Fissues\u002F10",{"id":112,"question_zh":113,"answer_zh":114,"source_url":115},32503,"使用 TensorFlow 1.0 或更高版本运行时出现 'TypeError: __init__() got multiple values for keyword argument' 等兼容性错误怎么办？","该代码最初基于 TensorFlow 0.9.0 编写，在新版本中需要微调 API 调用：\n1. 针对 `zeros_initializer` 报错：将 `resnet.py` 第 53 行改为 `fc_b = create_variables(name='fc_bias', shape=[num_labels], initializer=tf.zeros_initializer())`（注意括号）。\n2. 针对 `sparse_softmax_cross_entropy_with_logits` 报错：将相关行（如第 276 行）改为 `cross_entropy=tf.nn.sparse_softmax_cross_entropy_with_logits(None, labels, logits, name='cross_entropy_per_example')`。","https:\u002F\u002Fgithub.com\u002Fwenxinxu\u002Fresnet-in-tensorflow\u002Fissues\u002F4",{"id":117,"question_zh":118,"answer_zh":119,"source_url":120},32504,"在 Python 3 环境下运行出现 'ValueError: all the input arrays must have same number of dimensions' 错误如何修复？","这是因为在 Python 3 中处理 pickle 数据时初始化数组的方式不兼容导致的。在 `cifar10_input.py` 中，需要将初始化代码修改为显式指定维度：\n将原来的空数组初始化改为：\n`data = np.array([]).reshape([0, IMG_WIDTH])`\n确保 `data` 和后续拼接的 `batch_data` 具有相同的维度数。同时需将 `cPickle` 替换为 `pickle`，并将读取字典的方式改为 `dicts.get('data')`。","https:\u002F\u002Fgithub.com\u002Fwenxinxu\u002Fresnet-in-tensorflow\u002Fissues\u002F35",{"id":122,"question_zh":123,"answer_zh":124,"source_url":105},32505,"加载预训练 checkpoint 后继续训练，为什么错误率远高于预期（如 15% 而不是 7%）？","这通常是因为模型架构配置与加载的 checkpoint 不匹配，或者数据预处理不一致。请确认以下几点：\n1. 确保 `num_residual_blocks` 的设置与 checkpoint 对应的模型层数一致（例如 model_110 对应更深的网络，若设为 5 则不匹配）。\n2. 确认输入图像是否已正确 resize 到模型训练时的尺寸（通常是 32x32）。\n3. 检查分类类别数是否与 checkpoint 训练时的类别数（CIFAR-10 为 10 类）一致，若不一致需修改全连接层并重新初始化部分权重。",{"id":126,"question_zh":127,"answer_zh":128,"source_url":129},32506,"如何只微调（fine-tune）全连接层（fc layer）而冻结其他层？","虽然 Issue 中用户表示已自行解决，但通常做法是在优化器更新变量时，仅传入全连接层的变量列表。在 TensorFlow 中，可以通过 `tf.trainable_variables()` 筛选出包含 'fc' 关键字的变量，并将其传递给优化器的 `var_list` 参数，例如：\n`train_vars = [v for v in tf.trainable_variables() if 'fc' in v.name]`\n`train_op = optimizer.minimize(loss, var_list=train_vars)`\n这样可以确保反向传播时只更新全连接层的权重。","https:\u002F\u002Fgithub.com\u002Fwenxinxu\u002Fresnet-in-tensorflow\u002Fissues\u002F28",[]]