hankyul2 / EfficientNetV2-pytorch

EfficientNetV2 pytorch (pytorch lightning) implementation with pretrained model
Apache License 2.0
56 stars 13 forks source link

help!! How to test the weight of a specified path ? #5

Closed ObcTech closed 1 month ago

ObcTech commented 1 month ago

same as title ↑↑↑↑↑↑↑

hankyul2 commented 1 month ago

Hi @ObcTech

You can test the model using the below command:

python3 main.py test --config config/efficientnetv2_s/cifar10.yaml --trainer.gpus 2,3,

You can easily implement weight loading like below code snippet:

# Line 44 in main.py (https://github.com/hankyul2/EfficientNetV2-pytorch/blob/main/main.py)
self.model = get_efficientnet_v2(model_name, pretrained, num_classes, dropout=dropout)
state_dict = torch.load(checkpoint_path)
self.model.load_state_dict(state_dict)

Thank you.

Hankyul.