Lesson 1 learn.lr_find() gives #nan# in valid_loss

I am getting #na# when I ran learn.lr_find() from the lesson2-download notebook on my dataset. I had already made the necessary changes to make it work on the dataset I created.
This is the output of learn.lr_find().

epoch train_loss valid_loss error_rate time
0 0.199959 #na# 00:10
1 0.182260 #na# 00:09
2 0.171656 #na# 00:09
3 0.145169 #na# 00:09
4 0.149205 #na# 00:08
5 0.143180 #na# 00:09
6 0.136640 #na# 00:09
7 0.135336 #na# 00:09
8 0.122550 #na# 00:09
9 0.109931 #na# 00:08
10 0.097871 #na# 00:09
11 0.088499 #na# 00:08
12 0.083600 #na# 00:09
13 0.086121 #na# 00:10
14 0.236878 #na# 00:09

Does this affect the model? And how do I resolve this issue?

I’m facing the same issue in Lesson2 on COLAB :frowning_face: Any help is appreciated…

Hi Karanb. I’d suggest to paste your code and the specification of the system you are running on, so that it is easier to identify what the problem could be.

Also experiencing this issue when running lesson-2 notebook in colab.

The code is as in the default notebook.

learn.lr_find()

This is immediately after calling learn.unfreeze()

I also notice that in the printed results ‘time’ is sitting under the ‘error_rate’ heading, just like in OPs screenshot.

If I find the answer on another thread I will come back and post here.

Update: other forum users are explaining that valid_loss is not necessary for lr_finder, and printing as #na# is correct / appropriate.

Hi Team,

I am getting same the error for Lesson 2 - Download but here i am using cats,dogs,monkeys classes instead of bear types. But the issue is still the same.

lr_find does not use the validation set. So its not an issue really. Cheers!

Hi ,

I am getting error for ImageList:

Can anyone guide please?

@shiven_004
I’m guessing you’re using the fastaiv1 library.
ImageList doesnt have a .from_files attribute. You’re looking for .from_folder method.

Syntax: ImageList.from_folder(path)
where path is the path object of the folder where your data is present
Cheers!