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

迁移学习:使用自己的数据集对resnet50预训练模型进行微调 #34

Closed
284513016 opened this issue Dec 8, 2020 · 3 comments

Comments

@284513016
Copy link

您好
我们参考 https://pytorch.org/tutorials/beginner/transfer_learning_tutorial.html
利用自己的数据集对网络进行微调,我们遇到了困难
普通的resnet通过fc层输出in_featrues,进行微调训练,但是addernet中resnet的fc是conv2d,我不知道如何得到fc层的输入,或者说avgpool的输出。
期待您的回答,非常感谢。

@HantingChen
Copy link
Collaborator

你好,fc是conv2d和linear层对finetune没有影响,请参考你链接中Finetuning the convnet部分进行实验。

@284513016
Copy link
Author

你好,fc是conv2d和linear层对finetune没有影响,请参考你链接中Finetuning the convnet部分进行实验。

非常感谢您的答复,我没有将问题阐述清楚,链接中Finetuning the convnet部分的
num_ftrs = model_ft.fc.in_features,提取fc中的in_features后进行处理
但是addernet中fc是conv2d,没有in_features这个属性,只有输入输出通道数。
请问我们如何才能从addernet中得到fc的输入特征?
期待您的回复,万分感谢

@HantingChen
Copy link
Collaborator

你好,fc是conv2d和linear层对finetune没有影响,请参考你链接中Finetuning the convnet部分进行实验。

非常感谢您的答复,我没有将问题阐述清楚,链接中Finetuning the convnet部分的
num_ftrs = model_ft.fc.in_features,提取fc中的in_features后进行处理
但是addernet中fc是conv2d,没有in_features这个属性,只有输入输出通道数。
请问我们如何才能从addernet中得到fc的输入特征?
期待您的回复,万分感谢

你好,fc中的in_features相当于输入的特征维度,和conv2d中的输入通道数是一样的。

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