xiaohongshu
xiaohongshu
caffe-cifar-10
Guidance for building and training with the Caffe deep learning framework on CIFAR-10 dataset. This skill applies when tasks involve compiling Caffe from source, training convolutional neural networks on image classification datasets, or working with legacy deep learning frameworks that have comp...
Full skill instructions
This skill provides procedural guidance for building the Caffe deep learning framework from source and training models on the CIFAR-10 dataset. Caffe is a legacy framework (circa 2014-2017) with known compatibility issues on modern systems, requiring careful handling of dependencies and configuration.
Before attempting to build Caffe, research known compatibility issues for the target system:
pkg-config --modversion opencv4), Python version, compiler version, and CUDA version if applicablegit clone https://github.com/BVLC/caffe.git
cd caffe
git checkout v1.0 # Note: tag is "v1.0", not "v1.0.0"
Verification: Confirm the checkout with git describe --tags
Install all required dependencies before configuration:
Verification: For each library, verify installation with pkg-config --exists <library> or check header file presence
Copy and modify the configuration template:
cp Makefile.config.example Makefile.config
Key configuration decisions:
CPU_ONLY := 1 for CPU-only buildsOPENCV_VERSION := 3 - this causes compilation failuresVerification: Review the final Makefile.config for consistency - no duplicate definitions, no conflicting settings
For OpenCV 4.x compatibility, modify source files that use deprecated APIs:
cv::CV_LOAD_IMAGE_COLOR → cv::IMREAD_COLORCV_CAP_PROP_* → cv::CAP_PROP_*Verification: Grep for deprecated symbols before building
make clean # If retrying after failure
make all -j2 # Start with low parallelism
Critical: Avoid make -j$(nproc) initially - this can exhaust memory and cause silent failures. Scale up parallelism only after confirming stable compilation.
Verification: Check that build completes without OOM kills (dmesg | grep -i kill)
make test -j2
make pycaffe -j2
Verification: Run make runtest to verify build integrity
cd data/cifar10
./get_cifar10.sh
Verification: Check that LMDB or LevelDB files are created in the expected location
For custom iteration counts, edit examples/cifar10/cifar10_quick_solver.prototxt:
max_iter: Set to desired iteration countsnapshot: Set snapshot frequency appropriatelytest_interval: Adjust based on max_iterVerification: Validate prototxt syntax before training
./examples/cifar10/train_quick.sh
Verification: Monitor output for loss convergence and accuracy metrics
Confirm model files are created at the expected paths with expected accuracy.
Symptom: Compilation errors referencing CV_LOAD_IMAGE_COLOR, CV_LOAD_IMAGE_GRAYSCALE, or similar
Cause: Caffe 1.0 was written for OpenCV 2.x/3.x APIs
Solution: Apply OpenCV 4 compatibility patches to source files, or build OpenCV 3.x from source
Wrong approach: Setting OPENCV_VERSION := 3 without patching - this tells Caffe to expect OpenCV 3 APIs but doesn't make OpenCV 4 compatible
Symptom: Build process terminates with "Killed" message, no error output
Cause: Parallel compilation exhausting system memory
Solution: Use make -j2 or even make -j1 for memory-constrained systems
Verification: Check dmesg | tail -20 for OOM killer messages
Symptom: Conflicting or duplicate definitions cause unexpected build behavior
Cause: Incremental edits leaving multiple Python configurations or conflicting library paths
Solution: Plan all configuration changes before editing; review entire file for consistency after editing
Symptom: Marking steps complete before verification, leading to compounding errors
Cause: Assuming commands succeeded based on lack of immediate error
Solution: Verify each step explicitly before proceeding:
Symptom: Build fails looking for Python.h or numpy headers
Cause: PYTHON_INCLUDE paths in Makefile.config don't match system paths
Solution: Use python3 -c "import sysconfig; print(sysconfig.get_paths()['include'])" and python3 -c "import numpy; print(numpy.get_include())" to get correct paths
Before marking any major step complete, verify:
make runtest passesxiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience