How do I fix this error I got when trying the first FastAI example?

I tried the example in the readme:

using FastAI, FastVision
data, blocks = load(datarecipes()["imagenette2-320"])
task = ImageClassificationSingle(blocks)
learner = tasklearner(task, data, callbacks=[ToGPU()])
fitonecycle!(learner, 10)
showoutputs(task, learner)

It looks like it worked, except for displaying the output:


showoutputs(task, learner)
ERROR: MethodError: no method matching _print_table_with_text_back_end(::PrettyTables.PrintInfo; noheader=true, hlines=:all)
Closest candidates are:
  _print_table_with_text_back_end(::PrettyTables.PrintInfo; alignment_anchor_fallback, alignment_anchor_fallback_override, T, T, alignment_anchor_regex, autowrap, body_hlines, body_hlines_format, continuation_row_alignment, crop, crop_subheader, columns_width, display_size, equal_columns_width, ellipsis_line_skip, highlighters, hlines, linebreaks, maximum_columns_width, minimum_columns_width, newline_at_end, overwrite, reserved_display_lines, show_omitted_cell_summary, sortkeys, tf, title_autowrap, title_same_width_as_table, vcrop_mode, vlines, border_crayon, header_crayon, omitted_cell_summary_crayon, row_label_crayon, row_label_header_crayon, row_number_header_crayon, subheader_crayon, text_crayon, title_crayon) at ~/.julia/packages/PrettyTables/iAl0W/src/backends/text/text_backend.jl:11 got unsupported keyword argument "noheader"

I see there is indeed no argument named β€œnoheader” in that print_table… function:

I’m guessing that FastAI depends on an older version of the PrettyTables package. But anyway it seems like it should be easy for me to work around this without editing packages, etc. Perhaps parsing the output with my own function. How would I do it?

In general, is there a way for me to do something like R’s str(), where I can see all the elements of an object and arguments of a function? Eg:

> str(rnorm)
function (n, mean = 0, sd = 1)  
> x = data.frame(rnorm(10))
> str(x)
'data.frame':	10 obs. of  1 variable:
 $ rnorm.10.: num  0.587 0.761 -1.243 1.816 -0.318 ...

Maybe try the describe() command.

julia> describe(iris)
5Γ—7 DataFrame
 Row β”‚ variable     mean     min     median  max        nmissing  eltype                          
     β”‚ Symbol       Union…   Any     Union…  Any        Int64     DataType                        
─────┼────────────────────────────────────────────────────────────────────────────────────────────
   1 β”‚ SepalLength  5.84333  4.3     5.8     7.9               0  Float64
   2 β”‚ SepalWidth   3.05733  2.0     3.0     4.4               0  Float64
   3 β”‚ PetalLength  3.758    1.0     4.35    6.9               0  Float64
   4 β”‚ PetalWidth   1.19933  0.1     1.3     2.5               0  Float64
   5 β”‚ Species               setosa          virginica         0  CategoricalValue{String, UInt8}

Doesn’t look like it. That gives me errors for both task or learner.

The closest is dump, which gives me this (too many characters to paste here):

From that I gathered I could subset the learner object by doing eg learner.model, but if I try names(learner) and so on I get errors.

Of course I can look at all the source code to figure out what is going on. But is there any easy way to figure out what I need to do to manipulate an arbitrary object?

checkout FastVision and remove noheader=… from pretty_table() calls (3 times)

1 Like

Thanks Ill give it a try when I get a chance.