Spotted an error in your cross validation notebooks, can I put a PR for the same @muellerzr.
I have submitted a PR: https://github.com/muellerzr/Practical-Deep-Learning-for-Coders-2.0/pull/17
Spotted an error in your cross validation notebooks, can I put a PR for the same @muellerzr.
I have submitted a PR: https://github.com/muellerzr/Practical-Deep-Learning-for-Coders-2.0/pull/17
Hi, in the multilabel classification, in using datablocks, get_x method is being used to get the images from the table.
Instead of this can we use get_image_files() on the train folder and get the images from there? @muellerzr
Also, you say get_items() get the x and y together but in one of Jeremyâs notebook he uses get_items() to get the images and get_y=parent_labels to get the y values.
Thanks,
In the cross validation notebook, can we create the data using datablock api?
If yes, how to deal with the splitter as in this case we have split_list which is of type L and splitter expects a function.
thank you,
get_items
simply grabs whatever items are available to it. For instance we had our get_items
be get_image_files
, which grabs our filename. From that filename/location we can either add an additional get_x
or get_y
function to take that further. For instance parent_label
will grab the folderâs name that said filename was in.
Iâm not 100% sure youâd want to do this as the data is all within our DataFrame
itself. To me it wouldnât quite make sense to not use the data provided in its format.
Not really. Because we need to have any number of subsets and any number of splits. The medium level API is best for this type of problem.
Thanks for the reply,
So it is like the use of middle, medium and high level api are not interchangeable and each of them can be used for a specific purpose which the other api canât supplement. Am I right?
Not quite. The high level API is built upon the medium level API. Just some tasks getting it to fit in the high level API can be a pain, so you should go with the medium level. A prime example is having more than one train/test set such as this exact instance. You could generate a splitter that would then further generate every single split for the cross validation, but why should we when we already know our splits? Thus we move to the Datasets
level because we already have our splits set up for us each time.
I guess then you could override a DataBlock
âs splitter each time however changing it via an IndexSplitter
, but I find the Datasets
in this case easier to read. Do you follow me?
Thanks, got it clear
Hi @muellerzr I was trying to run your object detection notebook, it ran fine all the way to the end. So I tried run learn.get_preds()
which throws this error:
TypeError: object of type 'int' has no len()
Can you help me with this?
Yes get_preds and predict will fail IIRC. See earlier in the thread thereâs a link to an object detection thread. Along with that though if you want to go much deeper you can always just use raw pytorch and convert everything back with as much fastai as possible. See my speed up thread here for that info: Speeding Up fastai2 Inference - And A Few Things Learned (though not sure if the decodes will work OOTB this way)
In the cross validation notebook, our final accuracy is greater than the initial one but how do we do .predict using our final accuracy. As it is the summed up accuracy of 10 learner models.
Thanks,
Youâd need to get the raw predictions from the 10 then sum and average them together.
So to make a single new prediction Iâve to train the 10 models again and get raw predictions?
No, youâd use the 10 trained models that you have saved somewhere.
Ohhh, so the kfold for loop should be in such a way that each learner is saved (lyk⌠learn1,learn2âŚ) and the model by learn1.save(âmodel1â).
Finally get the raw predictions from these saved models:
learn1.load(âmodel1â)
learn1.get_preds(âtest_imgâ)
Am I right?
Yes, that is correct.
Thank you!
Went through and updated all the notebooks today for vision and tabular and fixed any bugs associated with them. Most noteably is any notebook that had multiple functions in get_y
, these are now wrapped inside a Pipeline
. See ImageWoof
for an example of this
In the style transfer notebook, while running _get_layers() function I get the following error:
â_vgg_config() is not definedâ
Although I have imported vgg19
Unsure why, on my notebooks it shows the proper variable name (which as an _
in the beginning as itâs a private function)
Oops Sorry, the screenshot is of the code when I tried without the ââ.
If I use the 'â also the get the same error: â_vgg_config() is not definedâ
Also, I didnât install nbdev nor used any of the # lines. Is it because of that?