since all jpeg images (train/valid/test) are in a single directory VOCdevkit/VOC2007/JPEGImages , making it cumbersome to split train/valid and then train/test.
if it’s a fixed split, then why not either move the images to different dirs before the data object is initialized, or alternatively use from_df or a similar method where you do the splitting on your own in the dataframe and then feed it to train/valid/test as you wish?
DataBunch.save exists now for all kinds of DataBunch (as long as you used the data block API to create it, or one of the factory methods) and you should load your data back with load_data (you can pass there a new batch size, new num workers etc…, if you don’t it will use the defaults of the library). Note that in vision, this doesn’t save the normalization call, so you’ll have to redo it (it saves everything prior to the call to databunch in the data block API, basically).
Breaking change in v1.0.44 (not a mean one)
Since this is a different serialization than before, it will break with the way TextDataBunch were saved up until now. But I’ve left the old TextDataBunch.load method that will allow you to load every DataBunch saved prior to v1.0.44, starting with this version, you’ll need to used load_data and not WhateteverDataBunch.load
Also, new: you can add your test set in the DataBunch object directly now: data.add_test works like the call to add_test in the data block API (can take a generator of items or an ItemList). As usual in fastai this is for unlabeled data you want to get predictions on.
fyi, 1.0.43 has a regression problem and was removed from conda/pypi - we will release a hotfix as soon as the problem is resolved. 1.0.42 until then is the flag product.
When I use load_learner after updating to .43 on a pre .43 model, I get “Can’t get attribute ‘MultiBatchRNNCore’”, and am wondering if I can use something similar to the load_old_to_new to rectify.
I am new to open source development, but would like to start with something small. I was reading through the code for lr_find and found a variable being passed to learn.fit, and it was named ahere. The variable is being passed as learn.fit's first parameter and that parameter is named as epochshere in the method definition. So, I thought it would be good to rename it in lr_find as well to epochs.
This I thought would be good chance to learn the process of submitting a PR. Let me know if its okay to submit a PR for this.
You can certainly do that.
Note that following the fastai style guide, we usually give very short names to variables that are used for a very short amount of time (here just one line), which is why its named a.
I am trying to figure out a way to add AdaptiveLogSoftmaxWithLoss as the last layer on a language model. I thought I had a way to get it to work with the callbacks but I feel like I am stuck, again.
I think the problem is from having the output and the loss tied up in the same function. The loss_batch() in basic_train.py seems to need for them to be separated. I thought I could use on_loss_begin to extract the tuple with (out,loss) from the final layer and then apply that loss. It also looked like I could use on_backward_begin(loss) to process the yb from that batch. But I still can’t quite pull it together.
Has anyone else looked at trying to add this layer? If so, any ideas/pointers?
I also realized, as I write this, that we could have our own AdaptiveLosSoftmax layer and a Loss that are not inter-connected. It would mean we loop twice rather than once, but might be cleaner to fit into the framework.