# Strange errors occurred when I optimized with Zygote and Optim

**URL:** <https://discourse.julialang.org/t/strange-errors-occurred-when-i-optimized-with-zygote-and-optim/47461>\
**Category:** General Usage\
**Tags:** optim, zygote\
**Created:** [September 29, 2020, 3:20am UTC](https://discourse.julialang.org/t/strange-errors-occurred-when-i-optimized-with-zygote-and-optim/47461 "2020-09-29T03:20:41Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [September 29, 2020, 1:00pm UTC](https://discourse.julialang.org/t/strange-errors-occurred-when-i-optimized-with-zygote-and-optim/47461/2 "2020-09-29T13:00:41Z")

</div>

Please do not post essentially the same question multiple times. Cf

> [@Does Optim not support function optimization with matrix variables?](https://discourse.julialang.org/t/does-optim-not-support-function-optimization-with-matrix-variables/47475):
>
> I want to optimize my function with Optim, but something went wrong . I have written an example. Does this example show that optim.jl does not support functions whose variables are matrices?If not, what should I do about it? using Zygote using Optim using RecursiveArrayTools function get\_f(A)   M=reshape(1:16,4,4)   U=exp(A)   T=UMU’   return tr(T) end function my\_function()   A0=zeros(4,4)   results=optimize(get\_f,VectorOfArray([A0])) end my\_function() And the…

---

_[View the full topic](https://discourse.julialang.org/t/strange-errors-occurred-when-i-optimized-with-zygote-and-optim/47461)._
