muellerzr / Practical-Deep-Learning-for-Coders-2.0

Notebooks for the "A walk with fastai2" Study Group and Lecture Series

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

learn.validate(dl=dl) throws 'DataFrame' object has no attribute 'with_cont'

RandallJEllis opened this issue · comments

Hey Zach,

Thank you so much for all of your notebooks, videos, and other contributions. I'm following along with the Adults notebook, but when I run the following lines, I get the error AttributeError: 'DataFrame' object has no attribute 'with_cont' on the learn.validate line.

dl = learn.dls.test_dl(test)
learn.validate(dl=dl)

Any help is appreciated.

Which notebook is this? As I currently don't see a reference to dl = learn.dls.test_dl(test) in the most recent version of 01_Adults, and just ran it in Colab just to be sure.

Ah, I see you closed this issue! What was the solution? (I've seen this pop on the forums so it would be great to know what causes it!)

I prematurely closed it because I thought I saw something on the fastai forums that would work but it didn't. Still having the same issue

Ah, well that is a bummer. What information can you tell me about your setup? System? fastai versions? etc

fastai version 2.0.13 on Google Colab

Just share it here if you can. I don't quite know the issue at hand because I just now tried both labelled and unlabeled.

I've requested access

Shared, I tried the above along with setting the test data into its own TabularPandas object as you'll see in the notebook.

Not sure why you would do that, we have test_dl to do this for us. Otherwise it'll get preprocessed wrong. (among a few other weird bits and pieces). Can you try cleaning it up and see from there?

IE: There is no need to wrap trn_dl, val_dl, all_dl, tst_dl, so it's all very confusing. You should only ever have one TabularPandas object, to which then you further use fastai bits and pieces to process your data.

Ah ok, I'll concatenate the training and test data. Since the test data has no labels, should I just fill those columns on the test data rows with 0s?

There's no need to do any of that. Process the test data separately following the examples at the bottom of the tabular notebook. I only section off parts of DataFrames as examples. The training and validation data should be merged though.

Since this is not a direct bug, please post on the forums with your issue, as I do not do 1:1 help like this unless it's a direct issue with one of my course notebooks itself.

Will do, thank you for the time and help