bilylee / SiamFC-TensorFlow

A TensorFlow implementation of the SiamFC tracker
MIT License
358 stars 112 forks source link

Problems about the code #18

Closed SMZCC closed 6 years ago

SMZCC commented 6 years ago

Dear @bilylee

Hello

Thanks for your contributions :tada:

I have encountered a problem in the code which lies in line .

out:

[1. 2. 3. 4. 5.]

mean: 0.0

mean: 6.0

mean: 4.5

mean: 4.0

mean: 3.75

not corresponding to my expectation

expected values are:

[1. 2. 3. 4. 5.]

mean: 3.0

mean: 3.0

mean: 3.0

mean: 3.0

mean: 3.0

reasons as following:

iter: 1

total = 1+2+3+4+5 = 15

count = 1+1+1+1+1 = 5

mean = 15 / 5 = 3

iter: 2

total = 15 + 15 = 30

count = 5 + 5 = 10

mean = 30 / 10 = 3

...


- Would you please told me I did anything wrong ? And how to understand it ?
#### Thanks in advance 
#### Best regards 
pmixer commented 6 years ago

Hi, @SMZCC Here's what I got, different from yours, 2018-04-23 9 59 30 as a personal opinion, the function aims to calculate how many response maps has a peak outside the manually labels center which makes it simple and intuitive, your question may lay on mechanisms of tensorflow. As for this issue, I suggest reading the official document and report your experiment settings here(os, tf version, python version, etc.), while I also got 0.0 in the first round (tf=1.4,cpu, py=2.7), I will be better to double check the step in execution.

bilylee commented 6 years ago

Sorry for the late reply, I have been very busy lately : (

It seems that the graph is evaluated differently when using tf.InteractiveSession. Change it to tf.Session, you should get expected outputs.

SMZCC commented 6 years ago

Wow ! You are right ! Thank you very much ! @bilylee :+1: of course for the warm hearts of @PeterHuang2015

bilylee commented 6 years ago

This parameter is the stride of the feature extractor. It is used for computing ground truth labels during training and target positions during testing.

I used convolutional_alexnet.stride = 8 in the early days of implementing SiamFC. Its usage is now replaced by https://github.com/bilylee/SiamFC-TensorFlow/blob/17f51563f081281fc7d966602d393715e7ecb469/configuration.py#L36

You can safely delete this line without affecting anything.

SMZCC commented 6 years ago

You can safely delete this line without affecting anything.

I have tried and found nothing changed , which made me confused, but now , it's OK.Thanks a lot !

Good job :+1: :muscle: @bilylee

Best regards