Lr_find throws error "TypeError: 'float' object cannot be interpreted as an integer"

Hello.
I’m trying to create a text classifier, but during lr_find, it throws this error:

LR Finder is complete, type {learner_name}.recorder.plot() to see the graph.

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-24-d81c6bd29d71> in <module>
----> 1 learn.lr_find()

~\Anaconda3\envs\fast-ai_projetT\lib\site-packages\fastai\train.py in lr_find(learn, start_lr, end_lr, num_it, stop_div, **kwargs)
     29     cb = LRFinder(learn, start_lr, end_lr, num_it, stop_div)
     30     a = int(np.ceil(num_it/len(learn.data.train_dl)))
---> 31     learn.fit(a, start_lr, callbacks=[cb], **kwargs)
     32 
     33 def to_fp16(learn:Learner, loss_scale:float=512., flat_master:bool=False)->Learner:

~\Anaconda3\envs\fast-ai_projetT\lib\site-packages\fastai\basic_train.py in fit(self, epochs, lr, wd, callbacks)
    164         callbacks = [cb(self) for cb in self.callback_fns] + listify(callbacks)
    165         fit(epochs, self.model, self.loss_func, opt=self.opt, data=self.data, metrics=self.metrics,
--> 166             callbacks=self.callbacks+callbacks)
    167 
    168     def create_opt(self, lr:Floats, wd:Floats=0.)->None:

~\Anaconda3\envs\fast-ai_projetT\lib\site-packages\fastai\basic_train.py in fit(epochs, model, loss_func, opt, data, callbacks, metrics)
     92     except Exception as e:
     93         exception = e
---> 94         raise e
     95     finally: cb_handler.on_train_end(exception)
     96 

~\Anaconda3\envs\fast-ai_projetT\lib\site-packages\fastai\basic_train.py in fit(epochs, model, loss_func, opt, data, callbacks, metrics)
     82             for xb,yb in progress_bar(data.train_dl, parent=pbar):
     83                 xb, yb = cb_handler.on_batch_begin(xb, yb)
---> 84                 loss = loss_batch(model, xb, yb, loss_func, opt, cb_handler)
     85                 if cb_handler.on_batch_end(loss): break
     86 

~\Anaconda3\envs\fast-ai_projetT\lib\site-packages\fastai\basic_train.py in loss_batch(model, xb, yb, loss_func, opt, cb_handler)
     16     if not is_listy(xb): xb = [xb]
     17     if not is_listy(yb): yb = [yb]
---> 18     out = model(*xb)
     19     out = cb_handler.on_loss_begin(out)
     20 

~\Anaconda3\envs\fast-ai_projetT\lib\site-packages\torch\nn\modules\module.py in __call__(self, *input, **kwargs)
    487             result = self._slow_forward(*input, **kwargs)
    488         else:
--> 489             result = self.forward(*input, **kwargs)
    490         for hook in self._forward_hooks.values():
    491             hook_result = hook(self, input, result)

~\Anaconda3\envs\fast-ai_projetT\lib\site-packages\torch\nn\modules\container.py in forward(self, input)
     90     def forward(self, input):
     91         for module in self._modules.values():
---> 92             input = module(input)
     93         return input
     94 

~\Anaconda3\envs\fast-ai_projetT\lib\site-packages\torch\nn\modules\module.py in __call__(self, *input, **kwargs)
    487             result = self._slow_forward(*input, **kwargs)
    488         else:
--> 489             result = self.forward(*input, **kwargs)
    490         for hook in self._forward_hooks.values():
    491             hook_result = hook(self, input, result)

~\Anaconda3\envs\fast-ai_projetT\lib\site-packages\fastai\text\models.py in forward(self, input)
    168         self.reset()
    169         raw_outputs, outputs = [],[]
--> 170         for i in range(0, sl, self.bptt):
    171             r, o = super().forward(input[:,i: min(i+self.bptt, sl)])
    172             if i>(sl-self.max_seq):

TypeError: 'str' object cannot be interpreted as an integer

and I have no idea why…
Do you ? Thanks, D.

Us neither since we can’t guess from just lr_find :wink:
If you want help, you have to provide your whole code.

It seems it was an issue with the version I used (1.30). I upgraded to the last one, and everything is alright.
More specificaly, on an earlier line, the model was not downloaded, which raise an error during training.
Thank you anyway,
D.