Practical overview
When it fits
Use Dgp when you want a research-code workflow for training and evaluating graph-propagation methods in zero-shot image classification, and can provide the specified Python dependencies, pretrained weights and image datasets.
Who it is for
- Researchers reproducing knowledge-graph propagation experiments for zero-shot learning.
- Computer-vision practitioners studying graph-network-based class prediction and ResNet fine-tuning.
Documented uses
- Generate induced and dense ImageNet knowledge graphs from the provided materials.
- Train the DGP dense-attention graph network and save model and class-prediction outputs.
- Fine-tune a ResNet with graph-network predictions and an ImageNet training directory.
- Evaluate predictions on ImageNet test-set configurations or AwA2.
Requirements & limits
The GitHub repository is public and lists an MIT license. The README specifies Python 3, PyTorch 0.4.0 and NLTK.
- The workflow is command-line Python research code, not a hosted classification interface.
- It requires external GloVe, pretrained ResNet-50, ImageNet and AwA2 resources.
- The README gives explicit output formats: .pth model state dictionaries and .pred files containing WordNet IDs and predicted fully connected weights.
- ImageNet evaluation supports 2-hop, 3-hop or all-class test-set choices; AwA2 has a separate evaluation script.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Prepare datasets and model materials
Set up the graph, ResNet and dataset resources needed by Dgp’s training and evaluation scripts.
Before you start
- Python 3, PyTorch 0.4.0 and NLTK.
- The repository’s materials/ directory.
- GloVe 6B embeddings, pretrained ResNet-50 weights, and ImageNet and AwA2 datasets.
Steps
Download and unzip the GloVe 6B archive; place glove.6B.300d.txt in materials/.
Run the three graph-generation scripts from materials/: make_induced_graph.py, make_dense_graph.py and make_dense_grouped_graph.py.
Download the specified ResNet-50 weights, rename them resnet50-raw.pth in materials/, then run process_resnet.py from materials/.
Create the materials/datasets/imagenet and materials/datasets/awa2 symbolic links to the dataset roots; ImageNet class folders use WordNet IDs, and the AwA2 root contains JPEGImages.
Expected outcome
The README specifies generated graph files, processed ResNet files and dataset paths for the later training and evaluation stages.
Guide limitations
- The guide prepares inputs only; it does not run training or evaluation.
- Dataset downloads and access are separate prerequisites.
- The README specifies PyTorch 0.4.0.
Train and evaluate the DGP graph network
Run the documented DGP graph-network training script and use its prediction file in a dataset evaluation script.
Before you start
- Prepared materials and dataset paths as described in the repository README.
- Python 3, PyTorch 0.4.0 and NLTK.
- A save/ directory; the README says the scripts default to GPU 0 and accept --gpu to choose devices.
Steps
Run python train_gcn_dense_att.py to train the DGP graph network; results are written to save/gcn-dense-att.
Choose a resulting .pred file, which contains predicted class WordNet IDs and predicted fully connected weights.
For ImageNet, run evaluate_imagenet.py with --cnn, --pred and --test-set; the documented test-set choices are 2-hops, 3-hops and all.
For AwA2, run evaluate_awa2.py with --cnn and --pred.
Expected outcome
The README describes trained graph-network outputs and scripts for ImageNet or AwA2 zero-shot classification evaluation.
Guide limitations
- Evaluation requires suitable ResNet weights and a graph-network .pred file.
- ImageNet and AwA2 datasets must be downloaded and laid out as specified.
- The guide reports documented commands, not a verified execution result.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 20 November 2026
- Original website title
- yinboc/DGP · Official homepage title · retained in its source language

