Troubles with 'train!' under Flux.jl whilst using 'Chain' function

I am new to Flux.jl and its application in the domain of Deep Learning. Running the introductory code (provided at Overview · Flux) seems to do a good job of showcasing Flux’s abilities.

The issue starts when I replace the model with multiple fully connected layers using ‘Chain’. For eg:

model = Chain(Dense(1, 1,relu),Dense(1,1))

The following error arises when I try and train the model:

MethodError: no method matching ChainRulesCore.InplaceableThunk(::NNlib.var"#32#35"{Matrix{Float32}, Matrix{Float32}}, ::ChainRulesCore.Thunk{NNlib.var"#33#36"{Matrix{Float32}, Matrix{Float32}}})
Closest candidates are:
ChainRulesCore.InplaceableThunk(::T, ::F) where {T<:ChainRulesCore.Thunk, F} at C:\Users\apujari1.julia\packages\ChainRulesCore\qbmEe\src\differentials\thunks.jl:116

I do not seem to be able to figure out what could be causing such an issue. Currently, I am using Julia 1.6.1.

I would highly appreciate an insight.

PS: Updating packages using Pkg.update() seem to have done nothing.

From the error message it looks like you might have a very old version of ChainRulesCore somehow, this signature was changed here last July, v0.10.

You can try ] add ChainRulesCore@1.12.0 to force an update, which if it fails may print something telling you (or telling someone here!) what other package is holding this back, if that is what’s happening.

Thank you for your response. Forcing an update provides the following error:

Unsatisfiable requirements detected for package IterativeSolvers [42fd0dbc]:
IterativeSolvers [42fd0dbc] log:
├─possible versions are: 0.7.0-0.9.2 or uninstalled
├─restricted by compatibility requirements with ConstrainedSystems [c257ce95] to versions: 0.8.0-0.8.5
│ └─ConstrainedSystems [c257ce95] log:
│ ├─possible versions are: 0.1.0-0.2.7 or uninstalled
│ └─restricted to versions 0.1.2-0.1 by ViscousStreaming [47fb7046], leaving only versions 0.1.2
│ └─ViscousStreaming [47fb7046] log:
│ ├─possible versions are: 0.1.0 or uninstalled
│ └─ViscousStreaming [47fb7046] is fixed to version 0.1.0
└─restricted by compatibility requirements with DiffEqBase [2b5f629d] to versions: 0.9.0-0.9.2 — no versions left
└─DiffEqBase [2b5f629d] log:
├─possible versions are: 3.13.2-6.81.3 or uninstalled
├─restricted by compatibility requirements with Reexport [189a3867] to versions: [3.13.2-6.53.6, 6.57.0-6.81.3] or uninstalled
│ └─Reexport [189a3867] log:
│ ├─possible versions are: 0.2.0-1.2.2 or uninstalled
│ └─restricted to versions 0.2 by ViscousStreaming [47fb7046], leaving only versions 0.2.0
│ └─ViscousStreaming [47fb7046] log: see above
├─restricted by compatibility requirements with ChainRulesCore [d360d2e6] to versions: [3.13.2-6.10.0, 6.59.1, 6.69.0-6.81.3] or uninstalled
│ └─ChainRulesCore [d360d2e6] log:
│ ├─possible versions are: 0.1.0-1.12.0 or uninstalled
│ └─restricted to versions 1.12.0 by an explicit requirement, leaving only versions 1.12.0
└─restricted by compatibility requirements with DiffEqCallbacks [459566f4] to versions: 6.11.0-6.81.3, leaving only versions: [6.59.1, 6.69.0-6.81.3]
└─DiffEqCallbacks [459566f4] log:
├─possible versions are: 2.0.0-2.20.1 or uninstalled
└─restricted to versions 2.14.0-2 by ViscousStreaming [47fb7046], leaving only versions 2.14.0-2.20.1
└─ViscousStreaming [47fb7046] log: see above

Stacktrace:
[1] propagate_constraints!(graph::Pkg.Resolve.Graph, sources::Set{Int64}; log_events::Bool)
@ Pkg.Resolve C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\Resolve\graphtype.jl:1048
[2] propagate_constraints! (repeats 2 times)
@ C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\Resolve\graphtype.jl:989 [inlined]
[3] simplify_graph!(graph::Pkg.Resolve.Graph, sources::Set{Int64}; clean_graph::Bool)
@ Pkg.Resolve C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\Resolve\graphtype.jl:1503
[4] simplify_graph! (repeats 2 times)
@ C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\Resolve\graphtype.jl:1503 [inlined]
[5] resolve_versions!(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec})
@ Pkg.Operations C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\Operations.jl:405
[6] targeted_resolve(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}, preserve::Pkg.Types.PreserveLevel)
@ Pkg.Operations C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\Operations.jl:1210
[7] tiered_resolve(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec})
@ Pkg.Operations C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\Operations.jl:1196
[8] _resolve
@ C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\Operations.jl:1216 [inlined]
[9] add(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}, new_git::Vector{Base.UUID}; preserve::Pkg.Types.PreserveLevel, platform::Base.BinaryPlatforms.Platform)
@ Pkg.Operations C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\Operations.jl:1231
[10] add(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; preserve::Pkg.Types.PreserveLevel, platform::Base.BinaryPlatforms.Platform, kwargs::Base.Iterators.Pairs{Symbol, IOContext{IOStream}, Tuple{Symbol}, NamedTuple{(:io,), Tuple{IOContext{IOStream}}}})
@ Pkg.API C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\API.jl:203
[11] add(pkgs::Vector{Pkg.Types.PackageSpec}; io::IOContext{IOStream}, kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ Pkg.API C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\API.jl:79
[12] add(pkgs::Vector{Pkg.Types.PackageSpec})
@ Pkg.API C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\API.jl:77
[13] do_cmd!(command::Pkg.REPLMode.Command, repl::IJulia.MiniREPL)
@ Pkg.REPLMode C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\REPLMode\REPLMode.jl:408
[14] do_cmd(repl::IJulia.MiniREPL, input::String; do_rethrow::Bool)
@ Pkg.REPLMode C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\REPLMode\REPLMode.jl:386
[15] top-level scope
@ In[2]:1
[16] eval
@ .\boot.jl:360 [inlined]
[17] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)
@ Base .\loading.jl:1094

I think the issue is with ViscousStreaming.jl installing sub-packages, versions of which cause a mismatch with sub-packages installed using ] add Flux. Otherwise, ] add ChainRulesCore@1.12.0 successfully forces an update and primary error ceases to exist.