Developer chat


#771

The test set should be added as a separate call after labelling, as per the docs. The fact ItemLists can have a test set is legacy (from the time we were labeling before splitting) and will be removed.


#772

Looks like a good idea. There seem to be a lot of common code with plot_top_losses, so can we isolate the part that computes the heatmaps in a separate function, then just add an argument to the current plot_top_losses (heatmap:bool=True) ?
Thanks for suggesting this!


(Vu Ha) #773

That makes sense. Working with PASCAL VOC2007 in the current design is a bit awkward, 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. Also, calling Learner.validate() after swapping validation with test set seems non-ideal. Any thought on best practices here?

Background: I am implementing a few models and trying to verify that they yield comparable test set-performances on common benchmarks.


(Stas Bekman) #774

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?


(Vu Ha) #775

Agree. I just moved to the images to a separate directory with train/valid/test structure.


#776

New

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.


(Austin Wallace) #777

Is it possible to use this with load_learner, rather than when you already have the learner object?


#778

I’m not sure what you mean. load_learner is for deploying your model at inference, this is to save the state of your data.


(Stas Bekman) #779

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.


Improving/Expanding Functional Tests
(Austin Wallace) #780

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.


(Stas Bekman) #781

Just give us another 10-20min or so we will have 1.0.43.post1 out shortly


#782

Yes, that function is there for that error.


#783

1.0.43.post1 is out and fixes the bug many of you were experiencing with models not training across applications. It was due to a problem in lr_find.


(Anirudh Sundar) #784

Hi guys,

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 a here. The variable is being passed as learn.fit's first parameter and that parameter is named as epochs here 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.

Thanks


#785

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.


(Florian Mutel) #786

Is it good practice to split models for lr in create_cnn

learn.split(ifnone(split_on meta[‘split’]))

even if pretrained is set to False ?


#787

It won’t hurt you: if you pass a single learning rate, it is used for all groups.


(Bobak Farzin) #788

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.

Any ideas/suggestions are appreciated.


(Stas Bekman) split this topic #789

8 posts were merged into an existing topic: AutoLRFinder


(Pierre Guillou) #796

Hi.
(I’m using fastai 1.0.45 on Windows 10) When I run the lesson7-wgan.ipynb notebook, I got the following error (see other post with the same problem):

NameError: name 'split_bn_bias' is not defined