File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -300,6 +300,10 @@ def validate(args):
300
300
301
301
crop_pct = 1.0 if test_time_pool else data_config ['crop_pct' ]
302
302
if args .naflex_loader :
303
+ model_patch_size = None
304
+ if hasattr (model , 'embeds' ) and hasattr (model .embeds , 'patch_size' ):
305
+ # NaFlexVit models have embeds.patch_size
306
+ model_patch_size = model .embeds .patch_size
303
307
from timm .data import create_naflex_loader
304
308
loader = create_naflex_loader (
305
309
dataset ,
@@ -315,7 +319,7 @@ def validate(args):
315
319
pin_memory = args .pin_mem ,
316
320
device = device ,
317
321
img_dtype = model_dtype or torch .float32 ,
318
- patch_size = 16 , # Could be derived from model config
322
+ patch_size = model_patch_size or ( 16 , 16 ),
319
323
max_seq_len = args .naflex_max_seq_len ,
320
324
)
321
325
else :
You can’t perform that action at this time.
0 commit comments