kentsommer / keras-inceptionV4

Keras Implementation of Google's Inception-V4 Architecture (includes Keras compatible pre-trained weights)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ImageNet Weight doesn't match the model

Arminkhayati opened this issue · comments

Hi

When I try to run this line of code:
x = create_model(num_classes=2, weights='imagenet', include_top=False)

it says :

Layer #1 (named "conv2d_1"), weight
<tf.Variable 'conv2d_1/kernel:0' shape=(3, 3, 32, 32) dtype=float32, numpy=
array([[[[-0.04279904, -0.03153341, 0.13684416, ...,
has shape (3, 3, 32, 32), but the saved weight has shape (32, 3, 3, 3).

Am I doing something wrong or it is the weight file problem?

Hey @Arminkhayati , Have you find any solution to your problem?
I am facing the same issue.

Hello,
@Arminkhayati @bhumikasinghrk for me, loading an earlier version of weights from Kent Sommer helped. Try changing the WEIGHT_PATH to 2.0 instead of 2.1

Hi,
I also had the problem with shape (32,3,3,3)
Heres what I did in addition to Georgiana's comments of changing to 2.0,
I also changed the input dimension to three channels (very similar to the code) [I was using one color image instead of three as input and hence I was facing the same issue].

I hope this helps!

Closing this out after a long hiatus from Github.

Sadly I did not and likely will not have time to dig into this. If folks have found a solution and are still running into this I will happily merge in any pull requests if folks have a desire to keep this working.