This project used the Relationformer code as a boilerplate to implement, train, and test the TopDiG model.
- CUDA>=9.2
- PyTorch>=1.7.1
For other system requirements please follow
pip install -r requirements.txt
cd ./models/ops
python setup.py install
Please download 20 US Cities dataset and organize them as following:
code_root/
└── data/
└── 20cities/
After downloading the dataset run the following script to preprocess and prepare the data for training
python generate_data.py
The config file can be found at .configs/road_rgb_2D.yaml
. Make custom changes if necessary.
For example, the command for training Relationformer is following:
python train.py --config configs/road_rgb_2D.yaml --cuda_visible_device 0 1 2 --nproc_per_node 3
Once you have the config file and trained model of Relation, run following command to evaluate it on test set:
python test.py --config configs/road_rgb_2D.yaml --checkpoint ./trained_weights/last_checkpoint.pt
Please find the debug_relationformer.ipynb
for interactive evaluation and visualization