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

ResNet18 with no top: How to obtain 512-dimensional vector? #71

Open
andrei-volkau opened this issue Dec 14, 2021 · 1 comment
Open

Comments

@andrei-volkau
Copy link

andrei-volkau commented Dec 14, 2021

I am wondering how to obtain a 512-dimensional vector for an image. I am interested in ResNet18 with no top layer.

As for now, I am getting a list of vectors like the following one.
list_of_vectors.txt

I expected getting one 512-dimensional vector for an image

@Marwen-Bhj
Copy link

This might be late, but can be of use for anyone faced this

ResNet18, preprocess_input = Classifiers.get('resnet18')
base_model = ResNet18(input_shape=(224,224,3), weights='imagenet', include_top=False)
output = keras.layers.GlobalAveragePooling2D()(base_model.output)
resnet18 = keras.models.Model(inputs=[base_model.input], outputs=[output])

And by the way adding a list of vectors text file like that doesn't make any sense, you could have just shared the shape of your output.

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

2 participants