Planet Classification Challenge

Hi all,
I am new to fastai. I have a question about probs.shape v.s.len(data.test_ds.fnames)

since probs.shape returns # (n_images, n_classes), is the n_images supposed to be the same as what returned bylen(data.test_ds.fnames)?

I have probs.shape (7186, 226) and len(data.test_ds.fnames) 39697

I have this question because when I run
df.insert(0, 'id', [o[5:-4] for o in data.test_ds.fnames])

I am getting this:

ValueError: Length of values does not match length of index

and… the test images in the test folder is 39705 , don’t know why it’s different then len(data.test_ds.fnames) 39697
(I am running the planet code on the different dataset and using dog breed submission code trying to create the submission file)

thx

Apologies

I’m running a local install on Ubuntu, fastai v1 and CUDA is installed OK first lesson not problem, and now I’m working through the planets suite but it’s causing me some Holstility ho ho ho

Hitting a problem with lr_find during the validation phase it’s telling me the following:-

Explored some Torch threads but I cannot make sense of what I need to do.

Advice gladly received

Regards

John

Updated environment 29th @ 3pm CET now works

I am working on the planet amazon classification. The data resizing line is as follows

sz = 64
data = get_data(sz)
data = data.resize(int(sz*1.3), ‘/tmp’)

Afterwards, when I’m calling img.shape on the images inside the data object I getting values other than sz. What seems to be the issue?

Is it setting the data object to sz of 64, and gets resized while the training?

I tried and converted the opt_th function a little bit to return the threshold also for validation set, And used that threshold for prediction. Can we do something like this. I did this type of threshold detection in anomaly detection problem.

def f2(preds, targs, start=0.17, end=0.24, step=0.01):
    with warnings.catch_warnings():
        warnings.simplefilter("ignore")
        return max([(fbeta_score(targs, (preds>th), 2, average='samples'),th)
                    for th in np.arange(start,end,step)])

And the above code will return maximum fbeta score and it’s corresponding threshold.