got-10k / siamfc

A minimal example (SiamFC in PyTorch) showing how to train and evaluate trackers using GOT-10k toolkit.
85 stars 14 forks source link

Error, loss stucks to zero when training with custom dataset #4

Open alphjheon opened 4 years ago

alphjheon commented 4 years ago

@huanglianghua I tried to use Siamfc tracker for a custom dataset. Using as the exemplar image (z) the first video frame, and the successive frames as the search images (x) for every iteration. The model doesn't seem to learn anything(loss stacked at 0.0). I got two questions:

*Should the input shape be fixed? (mine is 512x256 for both images)

*Also I noticed that in siamfc.py script, the init() constructor (lines 127-160) never executed during training.

Any help provided would be highly appreciated.

huanglianghua commented 4 years ago

By "successive frames", do you mean that you trained SiamFC using adjacent frame pairs (t and t + 1 frames)? If this is true, the training for SiamFC would be too easy, since adjacent frames are very alike. The original SiamFC randomly samples video image pairs within 100 frames, as a reference.

The input size of 512x256 is OK (any size that is divisible by 8 is OK) for training SiamFC. Just remember to change "exemplar_sz", "instance_sz" in pairwise.py and siamfc.py.

The init() function only executes at test phase. It is never used in the training phase.

Hope these helps.

alphjheon commented 4 years ago

Thank you. just a couple of questions in order to have a clear view. New "exemplar_sz" and "instance_sz" shapes should be changed to 256 (smallest dimension?). As I hypothesize, "*_sz" shapes denote the shape of the cropped region that cooperate in the cross-correlation process, which region is square-shaped, right?