Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Offset and loaded weights differ by one #14

Open
Ajaz-Ahmad opened this issue Aug 16, 2019 · 1 comment
Open

Offset and loaded weights differ by one #14

Ajaz-Ahmad opened this issue Aug 16, 2019 · 1 comment

Comments

@Ajaz-Ahmad
Copy link

Hi,

I was inspired by your code on loading weights for tiny yolo v2 from coco weight file. I have implemented my yolo network as below:
YOLO-Net

Yolo-Sub-Func

However, there is a difference in the final offset and loaded weights of 1. I am not able to figure out what mistake I am making. Could you please help me out?
Here is more details:
LoadingWeight
LoadingWeight_2
LoadingWeight_3
WeightLoader

Size of weight file is -> 44948600
Total number of params to load = 11237146
Loading 496 weights of conv0 ...
Loading 4736 weights of conv1 ...
Loading 18688 weights of conv2 ...
Loading 74240 weights of conv3 ...
Loading 295936 weights of conv4 ...
Loading 1181696 weights of conv5 ...
Loading 4722688 weights of conv6 ...
Loading 4720640 weights of conv7 ...
Loading 218025 weights of conv8 ...
len-> 11237145
len-> 11237146
Final offset = 11237145
Total number of params in the weight file = 11237146

Name of All Variables:
All Var [<tf.Variable 'conv0/kernel:0' shape=(3, 3, 3, 16) dtype=float32_ref>, <tf.Variable 'conv0_bn/gamma:0' shape=(16,) dtype=float32_ref>, <tf.Variable 'conv0_bn/beta:0' shape=(16,) dtype=float32_ref>, <tf.Variable 'conv0_bn/moving_mean:0' shape=(16,) dtype=float32_ref>, <tf.Variable 'conv0_bn/moving_variance:0' shape=(16,) dtype=float32_ref>, <tf.Variable 'conv1/kernel:0' shape=(3, 3, 16, 32) dtype=float32_ref>, <tf.Variable 'conv1_bn/gamma:0' shape=(32,) dtype=float32_ref>, <tf.Variable 'conv1_bn/beta:0' shape=(32,) dtype=float32_ref>, <tf.Variable 'conv1_bn/moving_mean:0' shape=(32,) dtype=float32_ref>, <tf.Variable 'conv1_bn/moving_variance:0' shape=(32,) dtype=float32_ref>, <tf.Variable 'conv2/kernel:0' shape=(3, 3, 32, 64) dtype=float32_ref>, <tf.Variable 'conv2_bn/gamma:0' shape=(64,) dtype=float32_ref>, <tf.Variable 'conv2_bn/beta:0' shape=(64,) dtype=float32_ref>, <tf.Variable 'conv2_bn/moving_mean:0' shape=(64,) dtype=float32_ref>, <tf.Variable 'conv2_bn/moving_variance:0' shape=(64,) dtype=float32_ref>, <tf.Variable 'conv3_1/kernel:0' shape=(3, 3, 64, 128) dtype=float32_ref>, <tf.Variable 'conv3_1_bn/gamma:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'conv3_1_bn/beta:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'conv3_1_bn/moving_mean:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'conv3_1_bn/moving_variance:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'conv4_1/kernel:0' shape=(3, 3, 128, 256) dtype=float32_ref>, <tf.Variable 'conv4_1_bn/gamma:0' shape=(256,) dtype=float32_ref>, <tf.Variable 'conv4_1_bn/beta:0' shape=(256,) dtype=float32_ref>, <tf.Variable 'conv4_1_bn/moving_mean:0' shape=(256,) dtype=float32_ref>, <tf.Variable 'conv4_1_bn/moving_variance:0' shape=(256,) dtype=float32_ref>, <tf.Variable 'conv5_1/kernel:0' shape=(3, 3, 256, 512) dtype=float32_ref>, <tf.Variable 'conv5_1_bn/gamma:0' shape=(512,) dtype=float32_ref>, <tf.Variable 'conv5_1_bn/beta:0' shape=(512,) dtype=float32_ref>, <tf.Variable 'conv5_1_bn/moving_mean:0' shape=(512,) dtype=float32_ref>, <tf.Variable 'conv5_1_bn/moving_variance:0' shape=(512,) dtype=float32_ref>, <tf.Variable 'conv6_1/kernel:0' shape=(3, 3, 512, 1024) dtype=float32_ref>, <tf.Variable 'conv6_1_bn/gamma:0' shape=(1024,) dtype=float32_ref>, <tf.Variable 'conv6_1_bn/beta:0' shape=(1024,) dtype=float32_ref>, <tf.Variable 'conv6_1_bn/moving_mean:0' shape=(1024,) dtype=float32_ref>, <tf.Variable 'conv6_1_bn/moving_variance:0' shape=(1024,) dtype=float32_ref>, <tf.Variable 'conv6_3/kernel:0' shape=(3, 3, 1024, 512) dtype=float32_ref>, <tf.Variable 'conv6_3_bn/gamma:0' shape=(512,) dtype=float32_ref>, <tf.Variable 'conv6_3_bn/beta:0' shape=(512,) dtype=float32_ref>, <tf.Variable 'conv6_3_bn/moving_mean:0' shape=(512,) dtype=float32_ref>, <tf.Variable 'conv6_3_bn/moving_variance:0' shape=(512,) dtype=float32_ref>, <tf.Variable 'conv_dec/kernel:0' shape=(1, 1, 512, 425) dtype=float32_ref>, <tf.Variable 'conv_dec/bias:0' shape=(425,) dtype=float32_ref>]
Thanks

@Ajaz-Ahmad
Copy link
Author

resolved it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant