Closed desertSniper87 closed 7 months ago
Hi, @desertSniper87, estimators are stored in the module estimators_
, but it looks like there is nothing in your classifier, could you show us how you initialized the model ?
Created the ensemble using this
from torchensemble import VotingClassifier
ensemble = VotingClassifier(
estimator=cct_model,
n_estimators=5,
cuda=True
)
Took the cct_model
from here:
from src import cct_7_7x2_224
cct_model = cct_14_7x2_224(**model_args)
OK, after fitting your ensemble model, you can simply index the target estimator using model = ensemble.estimators_[i]
, which should be a object of cct_model
, you can then extract the embeddings using the corresponding model parameter.
Thank you for your response.
Hey everyone!
I've been learning Torchensemble, and I wanted to know how you can extract the embeddings before the final classification layer.
Here is my ensemble model:
You see, there is a fc (fully connected layer) in the last of the base model. I want to delete it or replace it with Identity. How to do it? It seems removing the layer in the base estimator does not do anything.