[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-torrvision--crfasrnn":3,"tool-torrvision--crfasrnn":64},[4,17,26,40,48,56],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":16},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,3,"2026-04-05T11:01:52",[13,14,15],"开发框架","图像","Agent","ready",{"id":18,"name":19,"github_repo":20,"description_zh":21,"stars":22,"difficulty_score":23,"last_commit_at":24,"category_tags":25,"status":16},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 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",107662,2,"2026-04-03T11:11:01",[13,14,15],{"id":27,"name":28,"github_repo":29,"description_zh":30,"stars":31,"difficulty_score":23,"last_commit_at":32,"category_tags":33,"status":16},2268,"ML-For-Beginners","microsoft\u002FML-For-Beginners","ML-For-Beginners 是由微软推出的一套系统化机器学习入门课程，旨在帮助零基础用户轻松掌握经典机器学习知识。这套课程将学习路径规划为 12 周，包含 26 节精炼课程和 52 道配套测验，内容涵盖从基础概念到实际应用的完整流程，有效解决了初学者面对庞大知识体系时无从下手、缺乏结构化指导的痛点。\n\n无论是希望转型的开发者、需要补充算法背景的研究人员，还是对人工智能充满好奇的普通爱好者，都能从中受益。课程不仅提供了清晰的理论讲解，还强调动手实践，让用户在循序渐进中建立扎实的技能基础。其独特的亮点在于强大的多语言支持，通过自动化机制提供了包括简体中文在内的 50 多种语言版本，极大地降低了全球不同背景用户的学习门槛。此外，项目采用开源协作模式，社区活跃且内容持续更新，确保学习者能获取前沿且准确的技术资讯。如果你正寻找一条清晰、友好且专业的机器学习入门之路，ML-For-Beginners 将是理想的起点。",84991,"2026-04-05T10:45:23",[14,34,35,36,15,37,38,13,39],"数据工具","视频","插件","其他","语言模型","音频",{"id":41,"name":42,"github_repo":43,"description_zh":44,"stars":45,"difficulty_score":10,"last_commit_at":46,"category_tags":47,"status":16},3128,"ragflow","infiniflow\u002Fragflow","RAGFlow 是一款领先的开源检索增强生成（RAG）引擎，旨在为大语言模型构建更精准、可靠的上下文层。它巧妙地将前沿的 RAG 技术与智能体（Agent）能力相结合，不仅支持从各类文档中高效提取知识，还能让模型基于这些知识进行逻辑推理和任务执行。\n\n在大模型应用中，幻觉问题和知识滞后是常见痛点。RAGFlow 通过深度解析复杂文档结构（如表格、图表及混合排版），显著提升了信息检索的准确度，从而有效减少模型“胡编乱造”的现象，确保回答既有据可依又具备时效性。其内置的智能体机制更进一步，使系统不仅能回答问题，还能自主规划步骤解决复杂问题。\n\n这款工具特别适合开发者、企业技术团队以及 AI 研究人员使用。无论是希望快速搭建私有知识库问答系统，还是致力于探索大模型在垂直领域落地的创新者，都能从中受益。RAGFlow 提供了可视化的工作流编排界面和灵活的 API 接口，既降低了非算法背景用户的上手门槛，也满足了专业开发者对系统深度定制的需求。作为基于 Apache 2.0 协议开源的项目，它正成为连接通用大模型与行业专有知识之间的重要桥梁。",77062,"2026-04-04T04:44:48",[15,14,13,38,37],{"id":49,"name":50,"github_repo":51,"description_zh":52,"stars":53,"difficulty_score":10,"last_commit_at":54,"category_tags":55,"status":16},519,"PaddleOCR","PaddlePaddle\u002FPaddleOCR","PaddleOCR 是一款基于百度飞桨框架开发的高性能开源光学字符识别工具包。它的核心能力是将图片、PDF 等文档中的文字提取出来，转换成计算机可读取的结构化数据，让机器真正“看懂”图文内容。\n\n面对海量纸质或电子文档，PaddleOCR 解决了人工录入效率低、数字化成本高的问题。尤其在人工智能领域，它扮演着连接图像与大型语言模型（LLM）的桥梁角色，能将视觉信息直接转化为文本输入，助力智能问答、文档分析等应用场景落地。\n\nPaddleOCR 适合开发者、算法研究人员以及有文档自动化需求的普通用户。其技术优势十分明显：不仅支持全球 100 多种语言的识别，还能在 Windows、Linux、macOS 等多个系统上运行，并灵活适配 CPU、GPU、NPU 等各类硬件。作为一个轻量级且社区活跃的开源项目，PaddleOCR 既能满足快速集成的需求，也能支撑前沿的视觉语言研究，是处理文字识别任务的理想选择。",74939,"2026-04-05T23:16:38",[38,14,13,37],{"id":57,"name":58,"github_repo":59,"description_zh":60,"stars":61,"difficulty_score":23,"last_commit_at":62,"category_tags":63,"status":16},2471,"tesseract","tesseract-ocr\u002Ftesseract","Tesseract 是一款历史悠久且备受推崇的开源光学字符识别（OCR）引擎，最初由惠普实验室开发，后由 Google 维护，目前由全球社区共同贡献。它的核心功能是将图片中的文字转化为可编辑、可搜索的文本数据，有效解决了从扫描件、照片或 PDF 文档中提取文字信息的难题，是数字化归档和信息自动化的重要基础工具。\n\n在技术层面，Tesseract 展现了强大的适应能力。从版本 4 开始，它引入了基于长短期记忆网络（LSTM）的神经网络 OCR 引擎，显著提升了行识别的准确率；同时，为了兼顾旧有需求，它依然支持传统的字符模式识别引擎。Tesseract 原生支持 UTF-8 编码，开箱即用即可识别超过 100 种语言，并兼容 PNG、JPEG、TIFF 等多种常见图像格式。输出方面，它灵活支持纯文本、hOCR、PDF、TSV 等多种格式，方便后续数据处理。\n\nTesseract 主要面向开发者、研究人员以及需要构建文档处理流程的企业用户。由于它本身是一个命令行工具和库（libtesseract），不包含图形用户界面（GUI），因此最适合具备一定编程能力的技术人员集成到自动化脚本或应用程序中",73286,"2026-04-03T01:56:45",[13,14],{"id":65,"github_repo":66,"name":67,"description_en":68,"description_zh":69,"ai_summary_zh":70,"readme_en":71,"readme_zh":72,"quickstart_zh":73,"use_case_zh":74,"hero_image_url":75,"owner_login":76,"owner_name":77,"owner_avatar_url":78,"owner_bio":79,"owner_company":80,"owner_location":80,"owner_email":80,"owner_twitter":80,"owner_website":81,"owner_url":82,"languages":83,"stars":96,"forks":97,"last_commit_at":98,"license":99,"difficulty_score":100,"env_os":101,"env_gpu":102,"env_ram":103,"env_deps":104,"category_tags":118,"github_topics":80,"view_count":23,"oss_zip_url":80,"oss_zip_packed_at":80,"status":16,"created_at":119,"updated_at":120,"faqs":121,"releases":150},3951,"torrvision\u002Fcrfasrnn","crfasrnn","This repository contains the source code for the semantic image segmentation method described in the ICCV 2015 paper: Conditional Random Fields as Recurrent Neural Networks. http:\u002F\u002Fcrfasrnn.torr.vision\u002F","crfasrnn 是一款专注于语义图像分割的开源深度学习工具，源自牛津大学团队在 ICCV 2015 发表的著名论文《Conditional Random Fields as Recurrent Neural Networks》。它的核心任务不仅是识别图像中的物体类别，更能精准勾勒出物体的二维轮廓边界，从而生成细节丰富、边缘清晰的分割结果。\n\n传统分割方法往往在物体边缘处理上较为模糊，而 crfasrnn 创造性地将条件随机场（CRF）建模为循环神经网络（RNN）的一个层级，成功将概率图模型的精细推理能力与深度学习的端到端训练优势相结合。这一独特的技术亮点使得模型能够有效优化分割图的局部一致性，显著提升了边缘定位的准确度。\n\n该工具主要面向计算机视觉领域的研究人员和开发者。它基于 Caffe 框架开发，提供了自定义的\"MultiStageMeanfield\"网络层，方便用户将其集成到现有的全卷积网络（FCN）架构中进行二次开发或学术研究。此外，社区也衍生出了 PyTorch 和 TensorFlow\u002FKeras 版本，降低了不同技术栈使用者的上手门槛。虽然其最初研发愿景是用于辅助视障人","crfasrnn 是一款专注于语义图像分割的开源深度学习工具，源自牛津大学团队在 ICCV 2015 发表的著名论文《Conditional Random Fields as Recurrent Neural Networks》。它的核心任务不仅是识别图像中的物体类别，更能精准勾勒出物体的二维轮廓边界，从而生成细节丰富、边缘清晰的分割结果。\n\n传统分割方法往往在物体边缘处理上较为模糊，而 crfasrnn 创造性地将条件随机场（CRF）建模为循环神经网络（RNN）的一个层级，成功将概率图模型的精细推理能力与深度学习的端到端训练优势相结合。这一独特的技术亮点使得模型能够有效优化分割图的局部一致性，显著提升了边缘定位的准确度。\n\n该工具主要面向计算机视觉领域的研究人员和开发者。它基于 Caffe 框架开发，提供了自定义的\"MultiStageMeanfield\"网络层，方便用户将其集成到现有的全卷积网络（FCN）架构中进行二次开发或学术研究。此外，社区也衍生出了 PyTorch 和 TensorFlow\u002FKeras 版本，降低了不同技术栈使用者的上手门槛。虽然其最初研发愿景是用于辅助视障人士的增强现实眼镜项目，但目前已成为图像分割领域经典的基准算法之一，适合需要高精度物体轮廓提取场景的技术人员探索使用。","# CRF-RNN for Semantic Image Segmentation\n\n\u003Cb>Live demo:\u003C\u002Fb> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [http:\u002F\u002Fcrfasrnn.torr.vision](http:\u002F\u002Fcrfasrnn.torr.vision) \u003Cbr\u002F>\n\u003Cb>PyTorch version:\u003C\u002Fb> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[http:\u002F\u002Fgithub.com\u002Fsadeepj\u002Fcrfasrnn_pytorch](http:\u002F\u002Fgithub.com\u002Fsadeepj\u002Fcrfasrnn_pytorch)\u003Cbr\u002F>\n\u003Cb>Tensorflow\u002FKeras version:\u003C\u002Fb> [http:\u002F\u002Fgithub.com\u002Fsadeepj\u002Fcrfasrnn_keras](http:\u002F\u002Fgithub.com\u002Fsadeepj\u002Fcrfasrnn_keras)\u003Cbr\u002F>\n\n![sample](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftorrvision_crfasrnn_readme_a30f29b9a166.png)\n\n[![License (3-Clause BSD)](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-BSD%203--Clause-brightgreen.svg?style=flat-square)](https:\u002F\u002Fgithub.com\u002Ftorrvision\u002Fcrfasrnn\u002Fblob\u002Fmaster\u002FLICENSE)\n\n\n\nThis package contains code for the \"CRF-RNN\" semantic image segmentation method, published in the ICCV 2015 paper [Conditional Random Fields as Recurrent Neural Networks](http:\u002F\u002Fwww.robots.ox.ac.uk\u002F~szheng\u002Fpapers\u002FCRFasRNN.pdf). This paper was initially described in an [arXiv tech report](http:\u002F\u002Farxiv.org\u002Fabs\u002F1502.03240). The online demonstration based on this code won the Best Demo Prize at ICCV 2015. Our software is built on top of the [Caffe](http:\u002F\u002Fcaffe.berkeleyvision.org\u002F) deep learning library. The current version was developed by:\n\n[Sadeep Jayasumana](http:\u002F\u002Fwww.robots.ox.ac.uk\u002F~sadeep\u002F),\n[Shuai Zheng](http:\u002F\u002Fkylezheng.org\u002F),\n[Bernardino Romera Paredes](http:\u002F\u002Fromera-paredes.com\u002F), \n[Anurag Arnab](http:\u002F\u002Fwww.robots.ox.ac.uk\u002F~aarnab\u002F),\nand\nZhizhong Su.\n\nSupervisor: [Philip Torr](http:\u002F\u002Fwww.robots.ox.ac.uk\u002F~tvg\u002F)\n\nOur work allows computers to recognize objects in images, what is distinctive about our work is that we also recover the 2D outline of objects. Currently we have trained this model to recognize 20 classes. This software allows you to test our algorithm on your own images – have a try and see if you can fool it, if you get some good examples you can send them to us.\n\nWhy are we doing this? This work is part of a project to build augmented reality glasses for the partially sighted. Please read about it here: [smart-specs](http:\u002F\u002Fwww.va-st.com\u002Fsmart-specs\u002F). \n\nFor demo and more information about CRF-RNN please visit the project website: \u003Chttp:\u002F\u002Fcrfasrnn.torr.vision>.\n\nIf you use this code\u002Fmodel for your research, please cite the following papers:\n```\n@inproceedings{crfasrnn_ICCV2015,\n    author = {Shuai Zheng and Sadeep Jayasumana and Bernardino Romera-Paredes and Vibhav Vineet and\n    Zhizhong Su and Dalong Du and Chang Huang and Philip H. S. Torr},\n    title  = {Conditional Random Fields as Recurrent Neural Networks},\n    booktitle = {International Conference on Computer Vision (ICCV)},\n    year   = {2015}\n}\n```\n```\n@inproceedings{higherordercrf_ECCV2016,\n\tauthor = {Anurag Arnab and Sadeep Jayasumana and Shuai Zheng and Philip H. S. Torr},\n\ttitle  = {Higher Order Conditional Random Fields in Deep Neural Networks},\n\tbooktitle = {European Conference on Computer Vision (ECCV)},\n\tyear   = {2016}\n}\n```\n\n\n## How to use the CRF-RNN layer\nCRF-RNN has been developed as a custom Caffe layer named MultiStageMeanfieldLayer. Usage of this layer in the model definition prototxt file looks the following. Check the `matlab-scripts` or the `python-scripts` folder for more detailed examples.\n```\n# This is part of FCN, coarse is a blob coming from FCN\nlayer { type: 'Crop' name: 'crop' bottom: 'bigscore' bottom: 'data' top: 'coarse' }\n\n# This layer is used to split the output of FCN into two. This is required by CRF-RNN.\nlayer { type: 'Split' name: 'splitting'\n  bottom: 'coarse' top: 'unary' top: 'Q0'\n}\n\nlayer {\n  name: \"inference1\" # Keep the name \"inference1\" to load the trained parameters from our caffemodel.\n  type: \"MultiStageMeanfield\" # Type of this layer\n  bottom: \"unary\" # Unary input from FCN\n  bottom: \"Q0\" # A copy of the unary input from FCN\n  bottom: \"data\" # Input image\n  top: \"pred\" # Output of CRF-RNN\n  param {\n    lr_mult: 10000 # learning rate for W_G\n  }\n  param {\n    lr_mult: 10000 # learning rate for W_B\n  }\n  param {\n    lr_mult: 1000 # learning rate for compatiblity transform matrix\n  }\n  multi_stage_meanfield_param {\n    num_iterations: 10 # Number of iterations for CRF-RNN\n    compatibility_mode: POTTS # Initialize the compatilibity transform matrix with a matrix whose diagonal is -1.\n    threshold: 2\n    theta_alpha: 160\n    theta_beta: 3\n    theta_gamma: 3\n    spatial_filter_weight: 3\n    bilateral_filter_weight: 5\n  }\n}\n```\n## Installation Guide\nFirst, clone the project by running:\n```\ngit clone --recursive https:\u002F\u002Fgithub.com\u002Ftorrvision\u002Fcrfasrnn.git\n```\n\nYou need to compile the modified Caffe library in this repository. Instructions for Ubuntu 14.04 are included below. You can also consult the generic [Caffe installation guide](http:\u002F\u002Fcaffe.berkeleyvision.org\u002Finstallation.html) for further help.\n\n\n### 1.1 Install dependencies\n##### General dependencies\n```\nsudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf-compiler\nsudo apt-get install --no-install-recommends libboost-all-dev\n```\n\n##### CUDA (optional - needed only if you are planning to use a GPU for faster processing)\nInstall the correct CUDA driver and its SDK. Download CUDA SDK from Nvidia website. \n\nYou might need to blacklist some modules so that they do not interfere with the driver installation. You also need to uninstall your default Nvidia Driver first.\n```\nsudo apt-get install freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libgl1-mesa-glx libglu1-mesa libglu1-mesa-dev\n``` \nopen `\u002Fetc\u002Fmodprobe.d\u002Fblacklist.conf` and add:\n```\nblacklist amd76x_edac\nblacklist vga16fb\nblacklist nouveau\nblacklist rivafb\nblacklist nvidiafb\nblacklist rivatv\n```\n```\nsudo apt-get remove --purge nvidia*\n```\n\nWhen you restart your PC, before logging in, try \"Ctrl + Alt + F1\" to switch to a text-based login. Try:\n```\nsudo service lightdm stop\nchmod +x cuda*.run\nsudo .\u002Fcuda*.run\n```\n\n##### BLAS\nInstall a BLAS library such as ATLAS, OpenBLAS or MKL. To install BLAS:\n```\nsudo apt-get install libatlas-base-dev \n```\n\n##### Python \nInstall Anaconda Python distribution or install the default Python distribution with numpy, scipy, etc.\n\n##### MATLAB (optional - needed only if you are planning to use the MATLAB interface)\nInstall MATLAB using a standard distribution.\n\n### 1.2 Build the custom Caffe version\nSet the path correctly in the ``Makefile.config``. You can rename the ``Makefile.config.example`` to ``Makefile.config``, as most common parts are filled already. You may need to change it a bit according to your environment.\n\nAfter this, in Ubuntu 14.04, try:\n```\nmake\n```\n\nIf there are no error messages, you can then compile and install the Python and Matlab wrappers:\nTo install the MATLAB wrapper (optional):\n```\nmake matcaffe\n```\n\nTo install the Python wrapper (optional):\n```\nmake pycaffe\n```\n\nThat's it! Enjoy our software!\n\n\n### 1.3 Run the demo\nMATLAB and Python scripts for running the demo are available in the ``matlab-scripts`` and ``python-scripts`` directories, respectively. Both of these scripts do the same thing - you can choose either.\n\n#### Python users:\nChange the directory to ``python-scripts``. First download the model that includes the trained weights. In Linux, this can be done by:\n```\nsh download_trained_model.sh\n```\nAlternatively, you can also get the model by directly clicking the link in ``python-scripts\u002FREADME.md``.\n\nTo run the demo, execute:\n```\npython crfasrnn_demo.py\n```\nYou will get an output.png image.\n\nTo use your own images, replace \"input.jpg\" in the ``crfasrnn_demo.py`` file.\n\n#### MATLAB users:\nChange the directory to ``matlab-scripts``. First download the model that includes the trained weights. In Linux, this can be done by:\n```\nsh download_trained_model.sh\n```\nAlternatively, you can also get the model by directly clicking the link in ``matlab-scripts\u002FREADME.md``.\n\nLoad your MATLAB application and run ``crfrnn_demo.m``.\n\nTo use your own images, just replace \"input.jpg\" in the ``crfrnn_demo.m`` file.\n\nYou can also find a part of our model in [MatConvNet](http:\u002F\u002Fwww.vlfeat.org\u002Fmatconvnet\u002Fpretrained\u002F).\n\n\n#### Explanation about the CRF-RNN layer:\nIf you would like to try out the CRF-RNN model we trained, you should keep the layer name as it is (\"inference1\"), so that the code will correctly load the parameters from the caffemodel. Otherwise, it will reinitialize parameters.\n\nYou should find out that the end-to-end trained CRF-RNN model does better than the alternatives. If you set the CRF-RNN layer name to \"inference2\", you should observe lower performance since the parameters for both CNN and CRF are not jointly optimized.\n\n\n#### Training CRF-RNN on a new dataset:\nIf you would like to train CRF-RNN on other datasets, please follow the piecewise training described in our paper. In short, you should first train a strong pixel-wise CNN model. After this, you could plug our CRF-RNN layer into it by adding the MultiStageMeanfieldLayer to the prototxt file. You should then be able to train the CNN and CRF-RNN parts jointly end-to-end.\n\nNotice that the current deploy.prototxt file we have provided is tailored for PASCAL VOC Challenge. This dataset contains 21 class labels including background. You should change the num_output in the corresponding layer if you would like to finetune our model for other datasets. Also, the deconvolution layer in current code does not allow initializing the parameters through prototxt. If you change the num_output there, you should manually re-initialize the parameters in the caffemodel file.\n\nSee ``examples\u002Fsegmentationcrfasrnn`` for more information.\n\n\n#### Why predictions are all black?\nThis could happen if you change layer names in the model definition prototxt, causing the weights not to load correctly. This could also happen if you change the number of outputs in deconvolution layer in the prototxt but not initialize the deconvolution layer properly. \n\n#### MultiStageMeanfield causes a segfault?\nThis error usually occurs when you do not place the ``spatial.par`` and ``bilateral.par`` files in the script path.\n\n#### Python training script from third parties\nWe would like to thank martinkersner and MasazI for providing Python training scripts for CRF-RNN. \n\n1. [martinkersner's scripts](https:\u002F\u002Fgithub.com\u002Fmartinkersner\u002Ftrain-CRF-RNN)\n2. [MasazI's scripts](https:\u002F\u002Fgithub.com\u002FMasazI\u002Fcrfasrnn-training)\n\n#### Merge with the upstream caffe\nIt is possible to integrate the CRF-RNN code into upstream Caffe. However, due to the change of the crop layer, the caffemodel we provided might require extra training to provide the same accuracy. mtourne kindly provided a version that merged the code with upstream caffe. \n\n1. [mtourne upstream version with CRFRNN](https:\u002F\u002Fgithub.com\u002Fmtourne\u002Fcrfasrnn)\n\n#### GPU version of CRF-RNN\nhyenal kindly provided a purely GPU version of CRF-RNN. This would lead to considerably faster training and testing.\n\n1. [hyenal's GPU crf-rnn](https:\u002F\u002Fgithub.com\u002Fhyenal\u002Fcrfasrnn)\n\n#### CRF-as-RNN as a layer in Lasagne\n[Lasagne CRFasRNN layer](https:\u002F\u002Fgithub.com\u002Fhapemask\u002Fcrfrnn_layer)\n\n#### Latest Caffe with CPU\u002FGPU CRF-RNN\n[crfasrnn-caffe](https:\u002F\u002Fgithub.com\u002Ftorrvision\u002Fcaffe\u002Ftree\u002Fcrfrnn)\n\n#### Keras\u002FTensorflow version of CRF-RNN\n[crfasrnn_keras](https:\u002F\u002Fgithub.com\u002Fsadeepj\u002Fcrfasrnn_keras)\n\nLet us know if we have missed any other works from third parties.\n\n\nFor more information about CRF-RNN please visit the project website http:\u002F\u002Fcrfasrnn.torr.vision. Contact: \u003Ccrfasrnn@gmail.com>\n","# 用于语义图像分割的CRF-RNN\n\n\u003Cb>在线演示：\u003C\u002Fb> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [http:\u002F\u002Fcrfasrnn.torr.vision](http:\u002F\u002Fcrfasrnn.torr.vision) \u003Cbr\u002F>\n\u003Cb>PyTorch版本：\u003C\u002Fb> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[http:\u002F\u002Fgithub.com\u002Fsadeepj\u002Fcrfasrnn_pytorch](http:\u002F\u002Fgithub.com\u002Fsadeepj\u002Fcrfasrnn_pytorch)\u003Cbr\u002F>\n\u003Cb>TensorFlow\u002FKeras版本：\u003C\u002Fb> [http:\u002F\u002Fgithub.com\u002Fsadeepj\u002Fcrfasrnn_keras](http:\u002F\u002Fgithub.com\u002Fsadeepj\u002Fcrfasrnn_keras)\u003Cbr\u002F>\n\n![sample](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftorrvision_crfasrnn_readme_a30f29b9a166.png)\n\n[![许可证（3条款BSD）](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-BSD%203--Clause-brightgreen.svg?style=flat-square)](https:\u002F\u002Fgithub.com\u002Ftorrvision\u002Fcrfasrnn\u002Fblob\u002Fmaster\u002FLICENSE)\n\n\n\n本软件包包含“CRF-RNN”语义图像分割方法的代码，该方法发表于ICCV 2015论文《条件随机场作为递归神经网络》（[http:\u002F\u002Fwww.robots.ox.ac.uk\u002F~szheng\u002Fpapers\u002FCRFasRNN.pdf](http:\u002F\u002Fwww.robots.ox.ac.uk\u002F~szheng\u002Fpapers\u002FCRFasRNN.pdf)）。该论文最初在一篇[arXiv技术报告](http:\u002F\u002Farxiv.org\u002Fabs\u002F1502.03240)中有所介绍。基于此代码的在线演示荣获ICCV 2015最佳演示奖。我们的软件构建于[Caffe](http:\u002F\u002Fcaffe.berkeleyvision.org\u002F)深度学习框架之上。当前版本由以下人员开发：\n\n[Sadeep Jayasumana](http:\u002F\u002Fwww.robots.ox.ac.uk\u002F~sadeep\u002F)、\n[Shuai Zheng](http:\u002F\u002Fkylezheng.org\u002F)、\n[Bernardino Romera Paredes](http:\u002F\u002Fromera-paredes.com\u002F)、 \n[Anurag Arnab](http:\u002F\u002Fwww.robots.ox.ac.uk\u002F~aarnab\u002F)，\n以及\nZhizhong Su。\n\n指导教师：[Philip Torr](http:\u002F\u002Fwww.robots.ox.ac.uk\u002F~tvg\u002F)\n\n我们的工作使计算机能够识别图像中的物体，而我们工作的独特之处在于，我们还能恢复物体的二维轮廓。目前，我们已训练该模型识别20个类别。该软件允许您在自己的图像上测试我们的算法——不妨试一试，看看是否能骗过它；如果您有好的示例，欢迎发送给我们。\n\n我们为何要进行这项研究？这项工作是为部分失明人士开发增强现实眼镜项目的一部分。请在此处了解更多信息：[smart-specs](http:\u002F\u002Fwww.va-st.com\u002Fsmart-specs\u002F)。\n\n如需演示及更多关于CRF-RNN的信息，请访问项目官网：[http:\u002F\u002Fcrfasrnn.torr.vision](http:\u002F\u002Fcrfasrnn.torr.vision)。\n\n如果您在研究中使用此代码\u002F模型，请引用以下论文：\n```\n@inproceedings{crfasrnn_ICCV2015,\n    author = {Shuai Zheng and Sadeep Jayasumana and Bernardino Romera-Paredes and Vibhav Vineet and\n    Zhizhong Su and Dalong Du and Chang Huang and Philip H. S. Torr},\n    title  = {Conditional Random Fields as Recurrent Neural Networks},\n    booktitle = {International Conference on Computer Vision (ICCV)},\n    year   = {2015}\n}\n```\n```\n@inproceedings{higherordercrf_ECCV2016,\n\tauthor = {Anurag Arnab and Sadeep Jayasumana and Shuai Zheng and Philip H. S. Torr},\n\ttitle  = {Higher Order Conditional Random Fields in Deep Neural Networks},\n\tbooktitle = {European Conference on Computer Vision (ECCV)},\n\tyear   = {2016}\n}\n```\n\n\n## 如何使用CRF-RNN层\nCRF-RNN被开发为一个名为MultiStageMeanfieldLayer的自定义Caffe层。在模型定义prototxt文件中使用该层的方式如下所示。更多详细示例请参阅`matlab-scripts`或`python-scripts`文件夹。\n```\n# 这是FCN的一部分，coarse是一个来自FCN的blob\nlayer { type: 'Crop' name: 'crop' bottom: 'bigscore' bottom: 'data' top: 'coarse' }\n\n# 此层用于将FCN的输出拆分为两个。这是CRF-RNN所必需的。\nlayer { type: 'Split' name: 'splitting'\n  bottom: 'coarse' top: 'unary' top: 'Q0'\n}\n\nlayer {\n  name: \"inference1\" # 保持名称“inference1”，以便从我们的caffemodel加载预训练参数。\n  type: \"MultiStageMeanfield\" # 此层的类型\n  bottom: \"unary\" # 来自FCN的一元输入\n  bottom: \"Q0\" # FCN一元输入的副本\n  bottom: \"data\" # 输入图像\n  top: \"pred\" # CRF-RNN的输出\n  param {\n    lr_mult: 10000 # W_G的学习率\n  }\n  param {\n    lr_mult: 10000 # W_B的学习率\n  }\n  param {\n    lr_mult: 1000 # 兼容性变换矩阵的学习率\n  }\n  multi_stage_meanfield_param {\n    num_iterations: 10 # CRF-RNN的迭代次数\n    compatibility_mode: POTTS # 使用对角线为-1的矩阵初始化兼容性变换矩阵\n    threshold: 2\n    theta_alpha: 160\n    theta_beta: 3\n    theta_gamma: 3\n    spatial_filter_weight: 3\n    bilateral_filter_weight: 5\n  }\n}\n```\n## 安装指南\n首先，通过运行以下命令克隆项目：\n```\ngit clone --recursive https:\u002F\u002Fgithub.com\u002Ftorrvision\u002Fcrfasrnn.git\n```\n\n您需要编译此仓库中修改过的Caffe库。以下是针对Ubuntu 14.04的说明。您也可以参考通用的[Caffe安装指南](http:\u002F\u002Fcaffe.berkeleyvision.org\u002Finstallation.html)，以获取更多帮助。\n\n\n### 1.1 安装依赖项\n##### 一般依赖项\n```\nsudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf-compiler\nsudo apt-get install --no-install-recommends libboost-all-dev\n```\n\n##### CUDA（可选——仅当您计划使用GPU加速处理时才需要）\n安装正确的CUDA驱动程序及其SDK。从Nvidia官网下载CUDA SDK。\n\n您可能需要将某些模块列入黑名单，以免它们干扰驱动程序的安装。此外，您还需要先卸载默认的Nvidia驱动程序。\n```\nsudo apt-get install freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libgl1-mesa-glx libglu1-mesa libglu1-mesa-dev\n``` \n打开 `\u002Fetc\u002Fmodprobe.d\u002Fblacklist.conf` 并添加：\n```\nblacklist amd76x_edac\nblacklist vga16fb\nblacklist nouveau\nblacklist rivafb\nblacklist nvidiafb\nblacklist rivatv\n```\n```\nsudo apt-get remove --purge nvidia*\n```\n\n重启电脑后，在登录之前，尝试按“Ctrl + Alt + F1”切换到文本模式登录。然后尝试：\n```\nsudo service lightdm stop\nchmod +x cuda*.run\nsudo .\u002Fcuda*.run\n```\n\n##### BLAS\n安装ATLAS、OpenBLAS或MKL等BLAS库。安装BLAS：\n```\nsudo apt-get install libatlas-base-dev \n```\n\n##### Python \n安装Anaconda Python发行版，或安装带有numpy、scipy等的默认Python发行版。\n\n##### MATLAB（可选——仅当您计划使用MATLAB接口时才需要）\n使用标准发行版安装MATLAB。\n\n### 1.2 构建自定义Caffe版本\n在`Makefile.config`中正确设置路径。您可以将`Makefile.config.example`重命名为`Makefile.config`，因为其中大部分内容已经填写完毕。根据您的环境，您可能需要稍作调整。\n\n之后，在Ubuntu 14.04中，尝试：\n```\nmake\n```\n\n如果没有错误信息，您可以继续编译并安装Python和Matlab封装器：\n安装MATLAB封装器（可选）：\n```\nmake matcaffe\n```\n\n安装Python封装器（可选）：\n```\nmake pycaffe\n```\n\n好了！现在您可以享受我们的软件了！\n\n### 1.3 运行演示\n运行演示的 MATLAB 和 Python 脚本分别位于 `matlab-scripts` 和 `python-scripts` 目录中。这两个脚本的功能相同，您可以任选其一。\n\n#### Python 用户：\n切换到 `python-scripts` 目录。首先下载包含训练权重的模型。在 Linux 系统中，可以通过以下命令完成：\n```\nsh download_trained_model.sh\n```\n或者，您也可以直接点击 `python-scripts\u002FREADME.md` 文件中的链接来获取模型。\n\n要运行演示，请执行：\n```\npython crfasrnn_demo.py\n```\n您将得到一个名为 `output.png` 的输出图像。\n\n如果您想使用自己的图像，只需在 `crfasrnn_demo.py` 文件中将 `\"input.jpg\"` 替换为您想要处理的图像文件名即可。\n\n#### MATLAB 用户：\n切换到 `matlab-scripts` 目录。首先下载包含训练权重的模型。在 Linux 系统中，可以通过以下命令完成：\n```\nsh download_trained_model.sh\n```\n或者，您也可以直接点击 `matlab-scripts\u002FREADME.md` 文件中的链接来获取模型。\n\n打开您的 MATLAB 应用程序并运行 `crfrnn_demo.m` 文件。\n\n如果您想使用自己的图像，只需在 `crfrnn_demo.m` 文件中将 `\"input.jpg\"` 替换为您想要处理的图像文件名即可。\n\n此外，您还可以在 [MatConvNet](http:\u002F\u002Fwww.vlfeat.org\u002Fmatconvnet\u002Fpretrained\u002F) 中找到我们模型的一部分。\n\n#### 关于 CRF-RNN 层的说明：\n如果您希望尝试我们训练的 CRF-RNN 模型，务必保持层名称不变（即“inference1”），这样代码才能正确加载 caffemodel 中的参数。否则，参数将会被重新初始化。\n\n您会发现，端到端训练的 CRF-RNN 模型性能优于其他方法。如果将 CRF-RNN 层的名称改为“inference2”，则会观察到较低的性能，因为此时 CNN 和 CRF 的参数并未进行联合优化。\n\n#### 在新数据集上训练 CRF-RNN：\n如果您希望在其他数据集上训练 CRF-RNN，请按照我们论文中描述的分步训练方法进行。简而言之，您需要先训练一个强大的像素级 CNN 模型。随后，通过在 prototxt 文件中添加 MultiStageMeanfieldLayer，将我们的 CRF-RNN 层插入到该模型中。这样，您就可以对 CNN 和 CRF-RNN 部分进行端到端的联合训练。\n\n请注意，我们目前提供的 deploy.prototxt 文件是为 PASCAL VOC 挑战赛量身定制的。该数据集包含 21 个类别标签，包括背景。如果您希望将我们的模型微调用于其他数据集，应相应地修改相应层的 num_output 参数。此外，当前代码中的反卷积层无法通过 prototxt 文件初始化参数。如果您更改了那里的 num_output 值，就需要手动重新初始化 caffemodel 文件中的参数。\n\n更多详细信息请参阅 `examples\u002Fsegmentationcrfasrnn`。\n\n#### 为什么预测结果全为黑色？\n这可能是因为您在模型定义的 prototxt 文件中更改了层名称，导致权重未能正确加载。也可能是您在 prototxt 文件中修改了反卷积层的输出数量，但未正确初始化该层所致。\n\n#### MultiStageMeanfield 导致段错误？\n此错误通常发生在您未将 `spatial.par` 和 `bilateral.par` 文件放置在脚本运行路径中时。\n\n#### 第三方提供的 Python 训练脚本：\n我们感谢 martinkersner 和 MasazI 提供的 CRF-RNN Python 训练脚本。\n\n1. [martinkersner 的脚本](https:\u002F\u002Fgithub.com\u002Fmartinkersner\u002Ftrain-CRF-RNN)\n2. [MasazI 的脚本](https:\u002F\u002Fgithub.com\u002FMasazI\u002Fcrfasrnn-training)\n\n#### 与上游 Caffe 合并\nCRF-RNN 代码可以集成到上游 Caffe 中。然而，由于 crop 层的变化，我们提供的 caffemodel 可能需要额外的训练才能达到相同的精度。mtourne 友好地提供了一个将代码与上游 Caffe 合并的版本。\n\n1. [mtourne 的上游版本（含 CRFRNN）](https:\u002F\u002Fgithub.com\u002Fmtourne\u002Fcrfasrnn)\n\n#### CRF-RNN 的 GPU 版本\nhyenal 友好地提供了一个纯 GPU 版本的 CRF-RNN。这将显著加快训练和测试的速度。\n\n1. [hyenal 的 GPU 版 CRF-RNN](https:\u002F\u002Fgithub.com\u002Fhyenal\u002Fcrfasrnn)\n\n#### CRF-as-RNN 作为 Lasagne 中的一层\n[Lasagne CRFasRNN 层](https:\u002F\u002Fgithub.com\u002Fhapemask\u002Fcrfrnn_layer)\n\n#### 包含 CPU\u002FGPU CRF-RNN 的最新 Caffe\n[crfasrnn-caffe](https:\u002F\u002Fgithub.com\u002Ftorrvision\u002Fcaffe\u002Ftree\u002Fcrfrnn)\n\n#### Keras\u002FTensorFlow 版本的 CRF-RNN\n[crfasrnn_keras](https:\u002F\u002Fgithub.com\u002Fsadeepj\u002Fcrfasrnn_keras)\n\n如果您知道还有其他第三方的工作，请告知我们。\n\n有关 CRF-RNN 的更多信息，请访问项目官网 http:\u002F\u002Fcrfasrnn.torr.vision。联系方式：\u003Ccrfasrnn@gmail.com>","# CRF-RNN 快速上手指南\n\nCRF-RNN 是一种用于语义图像分割的深度学习模型，它将条件随机场（CRF）作为循环神经网络（RNN）层嵌入到 CNN 中，能够生成更精细的对象轮廓。本项目基于 Caffe 框架开发。\n\n## 1. 环境准备\n\n### 系统要求\n- **操作系统**: Linux (推荐 Ubuntu 14.04\u002F16.04，其他版本需参考通用 Caffe 安装指南)\n- **编译器**: GCC, G++\n- **GPU (可选)**: 若需加速，需安装 NVIDIA 驱动及 CUDA Toolkit\n\n### 前置依赖\n在安装前，请确保系统已安装以下基础库：\n\n```bash\n# 通用依赖\nsudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf-compiler\nsudo apt-get install --no-install-recommends libboost-all-dev\n\n# BLAS 库 (任选其一，如 ATLAS)\nsudo apt-get install libatlas-base-dev\n\n# Python 环境\n# 推荐安装 Anaconda 或确保已安装 python, numpy, scipy 等\n```\n\n**若需使用 GPU 加速**，请先卸载原有 NVIDIA 驱动并安装官方 CUDA：\n```bash\nsudo apt-get install freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libgl1-mesa-glx libglu1-mesa libglu1-mesa-dev\n# 编辑 \u002Fetc\u002Fmodprobe.d\u002Fblacklist.conf 添加黑名单（防止冲突）\n# 然后执行：\nsudo apt-get remove --purge nvidia*\n# 重启后进入文本模式安装 CUDA runfile\n```\n\n## 2. 安装步骤\n\n### 2.1 克隆项目\n使用递归克隆以获取子模块：\n```bash\ngit clone --recursive https:\u002F\u002Fgithub.com\u002Ftorrvision\u002Fcrfasrnn.git\ncd crfasrnn\n```\n\n### 2.2 配置编译选项\n复制配置文件模板并根据实际环境修改（如 Python 路径、CUDA 路径等）：\n```bash\ncp Makefile.config.example Makefile.config\n# 使用编辑器修改 Makefile.config 中的相关路径\n```\n\n### 2.3 编译 Caffe 及接口\n执行编译命令构建自定义 Caffe 库：\n```bash\nmake all -j8\n```\n\n若需使用 Python 或 MATLAB 接口，继续执行：\n```bash\n# 编译 Python 接口\nmake pycaffe\n\n# 编译 MATLAB 接口 (可选)\nmake matcaffe\n```\n\n## 3. 基本使用\n\n本项目提供了 Python 和 MATLAB 两种演示脚本，以下以 **Python** 为例。\n\n### 3.1 下载预训练模型\n进入脚本目录并下载包含权重的模型文件：\n```bash\ncd python-scripts\nsh download_trained_model.sh\n```\n*注：若下载速度慢，可手动访问 `python-scripts\u002FREADME.md` 中的链接下载。*\n\n### 3.2 运行演示\n执行演示脚本，程序将读取默认的 `input.jpg` 并输出分割结果 `output.png`：\n```bash\npython crfasrnn_demo.py\n```\n\n### 3.3 处理自定义图片\n若要测试自己的图片，只需修改 `crfasrnn_demo.py` 文件中的输入图片路径：\n```python\n# 在 crfasrnn_demo.py 中修改如下行\nim_file = 'your_image.jpg' \n```\n然后重新运行上述命令即可。\n\n---\n**提示**：该模型默认针对 PASCAL VOC 数据集训练（21 类，含背景）。若需在其他数据集上使用，需调整网络定义文件 (`prototxt`) 中的类别数量并重新训练。","某医疗影像分析团队正在开发辅助诊断系统，需要从肺部 CT 扫描图中精确分割出肿瘤区域以计算体积。\n\n### 没有 crfasrnn 时\n- 仅依靠基础卷积神经网络（如 FCN）输出的分割结果边缘粗糙，呈现明显的锯齿状，无法贴合肿瘤的真实不规则轮廓。\n- 模型容易将邻近的血管或正常组织误判为肿瘤的一部分，导致分割区域出现“粘连”现象，缺乏空间一致性。\n- 后处理需要人工编写复杂的形态学算法来平滑边缘和去除噪点，不仅增加了开发工作量，还难以适应不同病例的多样性。\n- 最终生成的 2D 轮廓精度不足，直接影响医生对肿瘤生长趋势的判断及手术方案的制定。\n\n### 使用 crfasrnn 后\n- crfasrnn 将条件随机场（CRF）作为循环神经网络层嵌入模型，自动优化像素间关系，生成的肿瘤边缘光滑且紧密贴合真实解剖结构。\n- 利用高阶上下文信息有效区分了肿瘤与周围相似组织，显著减少了误检和区域粘连，提升了分割的逻辑一致性。\n- 端到端的训练方式消除了对繁琐后处理算法的依赖，模型直接输出高质量掩码，大幅简化了工程落地流程。\n- 精确恢复的 2D 轮廓使得肿瘤体积计算误差降低，为临床医生提供了更可靠的量化数据支持。\n\ncrfasrnn 的核心价值在于将深度学习的全局特征提取能力与传统概率图模型的细节优化能力完美结合，实现了像素级语义分割精度的质的飞跃。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftorrvision_crfasrnn_a30f29b9.png","torrvision","Torr Vision Group","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Ftorrvision_7a820094.jpg","Torr Vision Group at the Department of Engineering Science of the University of Oxford, led by Prof. Philip Torr",null,"http:\u002F\u002Fwww.robots.ox.ac.uk\u002F~tvg","https:\u002F\u002Fgithub.com\u002Ftorrvision",[84,88,92],{"name":85,"color":86,"percentage":87},"MATLAB","#e16737",56.7,{"name":89,"color":90,"percentage":91},"Python","#3572A5",42.6,{"name":93,"color":94,"percentage":95},"Shell","#89e051",0.8,1340,456,"2026-03-08T01:58:37","NOASSERTION",5,"Linux","可选（用于加速处理），需安装 NVIDIA 驱动及 CUDA SDK，具体版本未说明","未说明",{"notes":105,"python":106,"dependencies":107},"该工具基于较旧的 Caffe 深度学习框架，README 中提供的安装指南主要针对 Ubuntu 14.04 系统。若需使用 GPU 加速，需手动安装 NVIDIA 驱动和 CUDA SDK 并可能涉及屏蔽默认显卡驱动的操作。此外，项目还提供了 PyTorch、TensorFlow\u002FKeras、MatConvNet 等其他框架的移植版本链接。运行演示前需下载预训练模型文件。","未说明（需安装 Anaconda 或默认发行版，含 numpy, scipy 等）",[108,109,110,111,112,113,114,115,116,117],"Caffe (定制修改版)","libprotobuf-dev","libleveldb-dev","libsnappy-dev","libopencv-dev","libhdf5-serial-dev","protobuf-compiler","libboost-all-dev","CUDA (可选)","BLAS (ATLAS\u002FOpenBLAS\u002FMKL)",[14],"2026-03-27T02:49:30.150509","2026-04-06T08:18:30.562279",[122,127,132,137,142,146],{"id":123,"question_zh":124,"answer_zh":125,"source_url":126},18033,"在 AWS G2\u002FK80 实例上运行时出现 'driver shutting down' 错误或核心转储（core dump）怎么办？","这通常与 Caffe 的静态缓冲区设置有关。如果您使用的是 K80 GPU，请尝试撤销 PR #2016 的更改（即不使用该补丁）。已知静态缓冲区会导致退出时崩溃：'Check failed: error == cudaSuccess (29 vs. 0) driver shutting down'。此外，请确保在重新编译前执行了 'make clean'，并检查您的 CUDA 版本（代码已在 CUDA 6.5, 7.0, 7.5 上测试通过）以及 .bashrc 配置是否正确。","https:\u002F\u002Fgithub.com\u002Ftorrvision\u002Fcrfasrnn\u002Fissues\u002F4",{"id":128,"question_zh":129,"answer_zh":130,"source_url":131},18034,"为什么我的代码在启用 GPU 模式下运行速度仍然很慢（例如需要 13 秒或 30 秒）？","如果运行时间约为 13 秒或更长，很可能您实际上并没有使用 GPU 进行计算，而是使用了纯 CPU 版本。请检查以下几点：\n1. 确认是否使用了正确的 Caffe 分支进行编译。\n2. 确认在 Python 代码中正确启用了 GPU 模式，例如设置 'net = caffe.Segmenter(MODEL_FILE, PRETRAINED, True)' 或调用 'caffe.set_mode_gpu()'。\n3. 正常的 GPU 运行时间参考：在 K80 或 P100 上应约为 4.5 秒；在 GTX 980 Ti 上约为 0.8 秒\u002F百万像素。如果在 K80 上看到约 5.2 秒（针对 319x500 图像）是正常的，但 30 秒显然异常。","https:\u002F\u002Fgithub.com\u002Ftorrvision\u002Fcrfasrnn\u002Fissues\u002F25",{"id":133,"question_zh":134,"answer_zh":135,"source_url":136},18035,"编译时提示找不到 'spatial.par' 或 'bilateral.par' 文件，或者出现格式警告，如何解决？","您需要 'spatial.par' 和 'bilateral.par' 文件来设置类别的超权重。这些文件必须存在于您运行脚本的路径中。您可以从项目提供的 python-scripts 目录中复制这些文件到相应位置。关于编译时出现的 '%lf' 格式警告（期望 double 但得到 float），这通常不会阻止编译，但如果运行时出现段错误（SIGSEGV），请确保上述 .par 文件已正确放置且路径无误。","https:\u002F\u002Fgithub.com\u002Ftorrvision\u002Fcrfasrnn\u002Fissues\u002F19",{"id":138,"question_zh":139,"answer_zh":140,"source_url":141},18036,"CRF-RNN 层是否在 GPU 上实现？显存不足（Out of Memory）怎么办？","在此实现中，CRF（条件随机场）部分确实没有在 GPU 上完全实现，主要计算仍在 CPU 上进行，这也是为什么有时 GPU 利用率 spike 很短的原因。关于显存：\n1. 最小显存要求较高，2GB 显存通常不足以运行演示或训练。\n2. 在 GTX 980 Ti (6GB) 上训练也可能在几次迭代后耗尽内存。\n3. 目前对于多 GPU 训练的支持有限，即使添加 '--gpu 0,1,2' 标志并调整 batch size 可能也无法正常工作。建议尝试更大的单卡显存或优化输入图像尺寸以降低内存需求。","https:\u002F\u002Fgithub.com\u002Ftorrvision\u002Fcrfasrnn\u002Fissues\u002F7",{"id":143,"question_zh":144,"answer_zh":145,"source_url":131},18037,"在 Windows 系统上运行 demo 时遇到 'no attribute bool' 或找不到 '_caffe.so' 错误怎么办？","该项目主要针对 Linux\u002FUnix 环境设计。在 Windows 上运行时需注意：\n1. Windows 下生成的库文件通常是 '_caffe.pyd' 而不是 '_caffe.so'，代码中可能需要相应调整导入逻辑。\n2. 不要尝试运行 'make pycaffe' 或修改 Makefile，因为这是针对 Ubuntu 的构建系统。Windows 用户应使用 Caffe 的 Visual Studio 解决方案（.sln）进行构建。\n3. 确保 'segmenter.py' 文件位于正确目录，以便 'crfasrnn_demo.py' 能找到它。如果遇到属性错误，可能是由于 Python 接口在 Windows 下的兼容性问题，建议检查 Caffe Windows 版的依赖项是否完整。",{"id":147,"question_zh":148,"answer_zh":149,"source_url":141},18038,"预期的 GPU 运行时间是多少？如何判断是否正常利用了 GPU？","预期的运行时间取决于硬件：\n- GTX 980 Ti: 约 0.8 秒\u002F百万像素。\n- K80: 约 4.5 - 5.2 秒（针对典型尺寸图像）。\n- CPU: 明显较慢，可能需要 7-8 秒或更多。\n判断 GPU 是否工作的方法：使用 'nvidia-smi' 监控 GPU 使用情况。您可能会看到 GPU 利用率有短暂的尖峰（例如 0.1 秒内超过 90%），然后迅速下降，这是因为 CRF 层主要在 CPU 运行，只有部分预处理或卷积在 GPU 运行。如果长时间没有 GPU 活动且速度慢，请检查是否真的启用了 GPU 模式。",[151,156],{"id":152,"version":153,"summary_zh":154,"released_at":155},108468,"0.2","这是基于 Caffe 的 CRF-RNN 代码的 beta（更好）版本。加入了 Jon Long 的未来版本及其支持。","2016-05-09T22:52:02",{"id":157,"version":158,"summary_zh":80,"released_at":159},108469,"0.1","2015-10-01T13:44:07"]