Skip to content

Expected param size (1150, 1) got (1150,) (BinSentimentClassifier) #35

Open
@Broever101

Description

@Broever101

Multiple issues with this one. Line 34 has SentimentClassifier which isn't defined anywhere which should be BinSentimentClassifier.
Moreover TextModels does not include the sentiment.jl file where BinSentimentClassifier is defined.
And then running this:

julia> using TextModels.ULMFiT

julia> c = ULMFiT.BinSentimentClassifier()
ERROR: Expected param size (1150, 1), got (1150,)
Stacktrace:
 [1] error(s::String)
   @ Base .\error.jl:33
 [2] loadparams!(m::TextModels.ULMFiT.BinSentimentClassifier, xs::Vector{Any})
   @ Flux C:\Users\Admin\.julia\packages\Flux\BPPNj\src\functor.jl:59
 [3] TextModels.ULMFiT.BinSentimentClassifier()
   @ TextModels.ULMFiT C:\Users\Admin\Desktop\work\TweetClassification\dev\TextModels\src\ULMFiT\sentiment.jl:75
 [4] top-level scope
   @ REPL[5]:1
 [5] top-level scope
   @ C:\Users\Admin\.julia\packages\CUDA\DfvRa\src\initialization.jl:52

Running the following below line 49 of ULMFiT/sentiment.jl:

i = 0
for (p, x) in zip(Flux.params(sc), weights)
    println("Iteration ", i)
    println("size(p): ", size(p))
    println("size(x): ", size(x))
    size(p) == size(x) || 
        error("Expected param size (size(p)), got (size(x))")
    i += 1
    println()
end

I get

image

Any workaround/solution?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions