Skip to content

Commit de40cbf

Browse files
authored
Merge pull request #64 from MichelML/patch-1
Improved error messages
2 parents 0a59075 + cb83b4f commit de40cbf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

efficientnet_pytorch/model.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,6 @@ def _check_model_name_is_valid(cls, model_name, also_need_pretrained_weights=Fal
207207
""" Validates model name. None that pretrained weights are only available for
208208
the first four models (efficientnet-b{i} for i in 0,1,2,3) at the moment. """
209209
num_models = 4 if also_need_pretrained_weights else 8
210-
valid_models = ['efficientnet_b'+str(i) for i in range(num_models)]
211-
if model_name.replace('-','_') not in valid_models:
210+
valid_models = ['efficientnet-b'+str(i) for i in range(num_models)]
211+
if model_name not in valid_models:
212212
raise ValueError('model_name should be one of: ' + ', '.join(valid_models))

0 commit comments

Comments
 (0)