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

AttributeError: 'ResNet' object has no attribute 'fe' #1

Open
YazhouTUD opened this issue Dec 26, 2021 · 1 comment
Open

AttributeError: 'ResNet' object has no attribute 'fe' #1

YazhouTUD opened this issue Dec 26, 2021 · 1 comment

Comments

@YazhouTUD
Copy link

When we try to use pretrained model to extract features, such as "python main.py --model ResNet18 --dataset cifar10 --strategy LeastConfidence --pretrained", it returns an error: AttributeError: 'ResNet' object has no attribute 'fe'.

The reason is related to line 303 in https://github.com/cure-lab/deep-active-learning/blob/main/query_strategies/strategy.py:
e1 = self.clf.fe.encode_image(x)

Could I ask how to solve this issue?

@yuli-yl
Copy link
Contributor

yuli-yl commented Dec 30, 2021

Hi,
The current model definition has not provided support for the pre-trained feature extractor yet. To use a pre-trained feature extractor, one way you could do is to extend the resnet definition with the encode_image function.

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