# I encountered a problem when using a convolutional neural network for training

**URL:** <https://discourse.julialang.org/t/i-encountered-a-problem-when-using-a-convolutional-neural-network-for-training/69087>\
**Category:** Machine Learning\
**Tags:** diffeq, flux, sciml\
**Created:** [October 2, 2021, 3:23am UTC](https://discourse.julialang.org/t/i-encountered-a-problem-when-using-a-convolutional-neural-network-for-training/69087 "2021-10-02T03:23:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wondering](https://avatars.discourse-cdn.com/v4/letter/w/a9a28c/32.png) [@wondering](https://discourse.julialang.org/u/wondering)\
**Post date:** [October 2, 2021, 3:23am UTC](https://discourse.julialang.org/t/i-encountered-a-problem-when-using-a-convolutional-neural-network-for-training/69087/1 "2021-10-02T03:23:53Z")

</div>

My task contains two neural networks. There is an MLP (Multilayer Perceptron) network named Model\_out in front, and its parameters are stored in: p\_out, re\_out = Flux.destructure(model\_out), and split\_i = length(p\_out); the second neural network is CNN, and its structure is: model\_in = Chain(Ccnv((3,), 2 =\> N, relu, pad = (0, 1))), and its parameters are stored in: p\_in, re\_in = Flux.destructure( model\_out); the parameters of the two networks are merged into: p = [p\_out; p\_in]; in addition, our task also needs to solve the ordinary differentiation equation (ODE); there is no problem with the forward propagation, but when the ODE is solved for back propagation, An error occurred: "UndefRefError: access to undefined reference; the error is located at NN\_in = re\_in(p[split\_i + 1: end])(inPut); I am wondering whether it is because the parameter arrangement of CNN is different from that of MLP, which caused me When using the index to call the parameter matrix p, there was an undefined reference problem. Can you give me some comments? Thanks!!
