def get_data(sz, bsz, val_idxs=[0], test_name='test'):
tfms = tfms_from_model(arch, sz, aug_tfms=transforms_side_on, max_zoom=1.1)
data = ImageClassifierData.from_csv(PATH, csv_fname=f'{DS_PATH}/labels.csv',
folder='train', test_name=test_name,
bs=bsz, tfms=tfms, val_idxs=val_idxs, suffix='.jpg')
return data if sz > 300 else data.resize(340, 'tmp')
Using the code above to build the data for a learner results in any saved models being saved in /tmp/340/tmp/models
.
I would like to recommend that the default be to look for a root /models directory in PATH
as a first option because if you ever have to blow out your /tmp
folder to get rid of precomputed activations, you’ll blow out your saved models as well. Another option is to make the models path an optional argument.