FluxML / MLJFlux.jl

Wrapping deep learning models from the package Flux.jl for use in the MLJ.jl toolbox
http://fluxml.ai/MLJFlux.jl/
MIT License
145 stars 17 forks source link

Metalhead has broken MLJFlux #249

Closed ablaom closed 5 months ago

ablaom commented 5 months ago

Tests are now failing for MLJFlux. The tests are running with Metalhead 0.9.3, but if I pin to 0.9.0 the tests pass.

┌ Error: Builder does not appear to build an architecture compatible with supplied data. 
└ @ MLJFlux ~/MLJ/MLJFlux/src/mlj_model_interface.jl:61
ImageClassifier basic tests (typename(CPU1)): Error During Test at /Users/anthony/MLJ/MLJFlux/test/test_utils.jl:38                                            
  Got exception outside of a @test
  UndefVarError: `VGG_CONV_CONFIGS` not defined
  Stacktrace:
    [1] VGGHack(depth::Int64; imsize::Tuple{Int64, Int64}, inchannels::Int64, nclasses::Int64, batchnorm::Bool, pretrain::Bool)                                                     
      @ MLJFlux ~/MLJ/MLJFlux/src/metalhead.jl:133
    [2] VGGHack
      @ ~/MLJ/MLJFlux/src/metalhead.jl:116 [inlined]
    [3] build(b::MLJFlux.MetalheadBuilder{typeof(MLJFlux.VGGHack)}, rng::StableRNGs.LehmerRNG, n_in::Tuple{Int64, Int64}, n_out::Int64, n_channels::Int64)           
      @ MLJFlux ~/MLJ/MLJFlux/src/metalhead.jl:101
    [4] build(model::ImageClassifier{MLJFlux.MetalheadBuilder{typeof(MLJFlux.VGGHack)}, typeof(softmax), Adam, typeof(Flux.Losses.crossentropy)}, rng::StableRNGs.LehmerRNG, shape::Tuple{Tuple{Int64, Int64}, Int64, Int64})                                                   
      @ MLJFlux ~/MLJ/MLJFlux/src/image.jl:14
    [5] fit(model::ImageClassifier{MLJFlux.MetalheadBuilder{typeof(MLJFlux.VGGHack)}, typeof(softmax), Adam, typeof(Flux.Losses.crossentropy)}, verbosity::Int64, X::Vector{Matrix{RGB{Float64}}}, y::CategoricalVector{Int64, UInt32, Int64, CategoricalValue{Int64, UInt32}, Union{}})                           
ablaom commented 5 months ago

Here's the Metalhead commit that appears to have caused the breakage: https://github.com/FluxML/Metalhead.jl/commit/09f91c0581676ad2b88163c6cc4ba59c8e67d037