# Flux train! no longer works

**URL:** <https://discourse.julialang.org/t/flux-train-no-longer-works/139543>\
**Category:** Machine Learning\
**Created:** [September 18, 2026, 8:11am UTC](https://discourse.julialang.org/t/flux-train-no-longer-works/139543 "2026-09-18T08:11:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![MathJulia](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mathjulia/32/224167_2.png) [@MathJulia](https://discourse.julialang.org/u/MathJulia)\
**Post date:** [September 18, 2026, 8:11am UTC](https://discourse.julialang.org/t/flux-train-no-longer-works/139543/1 "2026-09-18T08:11:05Z")

</div>

I have a neural network which has two parts. one encoder and the other main network. Due to recent changes in Flux.jl API, my code no longer works. I keep some of weights of main network and train them beside encoder. how to do it in newer flux.jl? do I have to pass two networks as model into loss(model, x, y)?

When I create a Chain model, I see Zygote error. The old Flux.train! no longer works. How to train my network now?

---

<div class="post-metadata">

**Author:** ![mbauman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbauman/32/31082_2.png) [@mbauman](https://discourse.julialang.org/u/mbauman)\
**Post date:** [September 18, 2026, 5:41pm UTC](https://discourse.julialang.org/t/flux-train-no-longer-works/139543/2 "2026-09-18T17:41:08Z")

</div>

What are you trying? What’s the error that you get back? See [Please read: make it easier to help you](https://discourse.julialang.org/t/please-read-make-it-easier-to-help-you/14757) for a bit more guidance on getting help here.
