Fastai v1 questions

Ok, this has now been integrated in the library. Feel free to start a documentation notebook for this new module!

2 Likes

It seems that bs has no effect. Is it used down the code? I passed the value of bs = 40,30 but got no effect at all. Every time I get same number of mini-batches. I think it is not used at all.

for bs= default I get [0/23310 00:02<5:43:11 4.1917]

for bs= 30 I get [0/23310 00:02<5:43:11 4.1917]

for bs= 40 I get [0/23310 00:02<5:43:11 4.1917]

It’s a bit hard to see what the problem could be without your code.

I am using the fastai objects to create DataBunch and a classifier. But I found the problem, now its working.

How do I check a learner batch size? I tried looking for it in learner.data.train_dl or train_ds. Couldn’t find.

I find it here data.train_dl.dl.batch_size

So, if I want to set a batch size I need to create a new DataBunch?

I haven’t followed your post but is it what you are looking for :smiley: learn.data.train_dl.dl.batch_size

1 Like

yes, thanks

So, am I right that there are no model-saving callbacks in the library so far?
Ah, nevermind, wasn’t able to find them in docs but see in the repo…

I am trying to convert some work on NLP to V1. I trained a RNNLearner with my corpus and saved the model, but to use it as a pretrained model I also need the itos, right? The model created is a .pth file and I can’t find any other file generated. Where/How does v1 stores the itos?

In the ‘tmp’ folder, you’ll find ‘itos.pkl’.

1 Like

Terminate on NaN stops when epoch ends. Can we stop a training immediately after a certain minibatch produces something undesirable (like NaN in gradients) and don’t have to wait for the entire epoch?

Hey,
How can I use nbsvm++ in fastai v1

Hi all,

How can we get the preprcessed tabular data as pandas dataframe?. I saw method to_df() but what is the right way to call it. When I check the docs I couldn’t find anything useful.

procs = [FillMissing, Normalize]
valid_idx = range(round(0.99*train_df_len), train_df_len)
data: DataBunch = TabularDataBunch.from_df(path, train_df, dep_var='target', procs=procs, valid_idx=valid_idx, test_df=test_df)

regards.

You can access the inner dataframe of the training/validation or test set with

data.train_ds.x.inner_df

(replace train by valid or test if necessary).

Thank you for your help. But I receive below error.
_

AttributeError Traceback (most recent call last)
in
----> 1 data.train_ds.x.inner_df

AttributeError: ‘TabularList’ object has no attribute ‘inner_df’

Oh, that’s only on master for now, I forgot I added it recently. Before 1.0.46 it’s called xtra: data.train_ds.x.xtra

Thank you. It works.

On windows ‘1.0.49.dev0’ version has some problems with tabular example. I can predict but

preds, y = learn.get_preds(ds_type=DatasetType.Test)

returns with out any results and warning. Any suggestions ?