forked from pytorch/vision
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add pretrained weights on Chairs and Things for raft_large (pytorch#5060
1 parent
d416b2c
commit 849d02b
Showing
5 changed files
with
157 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Optical flow reference training scripts | ||
|
||
This folder contains reference training scripts for optical flow. | ||
They serve as a log of how to train specific models, so as to provide baseline | ||
training and evaluation scripts to quickly bootstrap research. | ||
|
||
|
||
### RAFT Large | ||
|
||
The RAFT large model was trained on Flying Chairs and then on Flying Things. | ||
Both used 8 A100 GPUs and a batch size of 2 (so effective batch size is 16). The | ||
rest of the hyper-parameters are exactly the same as the original RAFT training | ||
recipe from https://github.com/princeton-vl/RAFT. | ||
|
||
``` | ||
torchrun --nproc_per_node 8 --nnodes 1 train.py \ | ||
--dataset-root $dataset_root \ | ||
--name $name_chairs \ | ||
--model raft_large \ | ||
--train-dataset chairs \ | ||
--batch-size 2 \ | ||
--lr 0.0004 \ | ||
--weight-decay 0.0001 \ | ||
--num-steps 100000 \ | ||
--output-dir $chairs_dir | ||
``` | ||
|
||
``` | ||
torchrun --nproc_per_node 8 --nnodes 1 train.py \ | ||
--dataset-root $dataset_root \ | ||
--name $name_things \ | ||
--model raft_large \ | ||
--train-dataset things \ | ||
--batch-size 2 \ | ||
--lr 0.000125 \ | ||
--weight-decay 0.0001 \ | ||
--num-steps 100000 \ | ||
--freeze-batch-norm \ | ||
--output-dir $things_dir\ | ||
--resume $chairs_dir/$name_chairs.pth | ||
``` | ||
|
||
|
||
### Evaluation | ||
|
||
``` | ||
torchrun --nproc_per_node 1 --nnodes 1 train.py --val-dataset sintel --batch-size 1 --dataset-root $dataset_root --model raft_large --pretrained | ||
``` | ||
|
||
This should give an epe of about 1.3822 on the clean pass and 2.7161 on the | ||
final pass of Sintel. Results may vary slightly depending on the batch size and | ||
the number of GPUs. For the most accurate resuts use 1 GPU and `--batch-size 1`: | ||
|
||
``` | ||
Sintel val clean epe: 1.3822 1px: 0.9028 3px: 0.9573 5px: 0.9697 per_image_epe: 1.3822 f1: 4.0248 | ||
Sintel val final epe: 2.7161 1px: 0.8528 3px: 0.9204 5px: 0.9392 per_image_epe: 2.7161 f1: 7.5964 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters