Flux train! no longer works

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?

What are you trying? What’s the error that you get back? See Please read: make it easier to help you for a bit more guidance on getting help here.