Skip to content

Offset and loaded weights differ by one #14

Open
@Ajaz-Ahmad

Description

@Ajaz-Ahmad

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions