Open weizhenFrank opened 4 years ago
@weizhenFrank I had the same problem.
EfficientNet.from_name("efficientnet-b1", {"num_classes": 2})
worked for me.
.from_name() loads parameters from dictionary.
https://github.com/lukemelas/EfficientNet-PyTorch/blob/d8481a539cc1f84ef0fe502f9c12dcc187669611/efficientnet_pytorch/model.py#L203
Thanks for your great effort in the implementation of efficientnet in pytorch which provide huge convenience for me. But when I use model by EfficientNet.from_name("efficientnet-b1",num_classes=2), it raised error "TypeError: from_name() got an unexpected keyword argument 'num_classes'". As I want use my own dataset to train the model from scratch, could you do me a favor?