-
I am using the latest timm version '1.0.7' If I run this piece of code everything runs as expected:
However if I switch efficientnet_b0 to resnet18 I get an error as out.shape = [2, 64, 32, 32] This used to work previously, did something change in the create_model API recently? What is now the recommended way to extract features of any model and get the corresponding size automatically ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
@Optimox the API did change a little bit, I added a 'head_hidden_size' for determining pre_logits shape for models where that's different, however it should not impact efficientnet or resnet ( #2224 has cut and paste code of what the latest tests are validating for the models EDIT: also, if what your observing happens, the unit tests would fail as that's checked as per the snippests in that other discussion, no other changes are made to the lib? |
Beta Was this translation helpful? Give feedback.
@Optimox the API did change a little bit, I added a 'head_hidden_size' for determining pre_logits shape for models where that's different, however it should not impact efficientnet or resnet (
head_hidden_size
=num_features
there) and I just checked and it seems fine, model.num_features is 512 for resnet18 and 1280 for efficiientnet_b0 and it matches the output#2224 has cut and paste code of what the latest tests are validating for the models
EDIT: also, if what your observing happens, the unit tests would fail as that's checked as per the snippests in that other discussion, no other changes are made to the lib?