# Alarming incorrect computation in Flux / Juno?

**URL:** <https://discourse.julialang.org/t/alarming-incorrect-computation-in-flux-juno/33017>\
**Category:** Machine Learning\
**Created:** [January 6, 2020, 5:27am UTC](https://discourse.julialang.org/t/alarming-incorrect-computation-in-flux-juno/33017 "2020-01-06T05:27:17Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jaynick](https://avatars.discourse-cdn.com/v4/letter/j/71c47a/32.png) [@jaynick](https://discourse.julialang.org/u/jaynick)\
**Post date:** [January 6, 2020, 5:27am UTC](https://discourse.julialang.org/t/alarming-incorrect-computation-in-flux-juno/33017/1 "2020-01-06T05:27:17Z")

</div>

have a look at this bug [https://github.com/FluxML/Flux.jl/issues/982](https://github.com/FluxML/Flux.jl/issues/982)

Am I correct in thinking that is is really serious error?  
Conv gives not repeatable, quite reandom results.

I was able to repeat the bug running in Atom/Juno on Mac with Julia1.3.1+Flux0.9.

Thinking it was time to give up on julia and run!

However, running the same examples in the terminal REPL, _the bug did not happen._ This is using the same Julia that Juno uses, 1.3.1+Flux0.9. Also tried in Julia1.3.0+Flux0.10 terminal on Linux, no issue there.

So it seems like this is something to do with running in Juno???

An even smaller way to show the problem:

```julia
    batchsize = 2
    ii = randn(Float32, 5,4,3,batchsize)
    ll = Conv((3,3), 3=>3)
    maximum(ll(ii)-ll(ii))

```

Repeat that last line about 10 times. Usually the result is zero (correct) but sometimes it is a large number. Increased batchsize makes it happen sooner.

---

<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:** [January 6, 2020, 7:34am UTC](https://discourse.julialang.org/t/alarming-incorrect-computation-in-flux-juno/33017/2 "2020-01-06T07:34:42Z")

</div>

Since there is already an open issue, it would be best to discuss the bug there. You could check the package versions and the Julia version you have when running in Juno (`pkg> st --manifest Flux`) and the REPL, to see if there is any difference.

> [@jaynick](#):
>
> Thinking it was time to give up on julia and run!

That is of course up to you; but bugs happen in all complex software.

---

<div class="post-metadata">

**Author:** ![Gunter\_Faes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunter_faes/32/12580_2.png) [@Gunter\_Faes](https://discourse.julialang.org/u/Gunter_Faes)\
**Post date:** [January 6, 2020, 9:23am UTC](https://discourse.julialang.org/t/alarming-incorrect-computation-in-flux-juno/33017/3 "2020-01-06T09:23:33Z")

</div>

I understand [jaynick](https://discourse.julialang.org/u/jaynick) already! It’s a bit frustrating when Flux switches to zygote and a number of bugs come up. Before Flux (0.8.3) did what it was supposed to do (that’s my impression) and now - again from my point of view - it’s quiet about correction and further development.

But it is clear, I will not give up Julia! 😀

---

<div class="post-metadata">

**Author:** ![jaynick](https://avatars.discourse-cdn.com/v4/letter/j/71c47a/32.png) [@jaynick](https://discourse.julialang.org/u/jaynick)\
**Post date:** [January 6, 2020, 6:13pm UTC](https://discourse.julialang.org/t/alarming-incorrect-computation-in-flux-juno/33017/4 "2020-01-06T18:13:25Z")

</div>

I believe this is not related to Zygote at all. The example does not use AD, and it does not happen outside of Juno In my test.

---

<div class="post-metadata">

**Author:** ![Gunter\_Faes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunter_faes/32/12580_2.png) [@Gunter\_Faes](https://discourse.julialang.org/u/Gunter_Faes)\
**Post date:** [January 6, 2020, 6:48pm UTC](https://discourse.julialang.org/t/alarming-incorrect-computation-in-flux-juno/33017/5 "2020-01-06T18:48:47Z")

</div>

Yes of course. I let myself go a little bit because Flux “doesn’t run smoothly anymore”. 🙄

---

<div class="post-metadata">

**Author:** ![jaynick](https://avatars.discourse-cdn.com/v4/letter/j/71c47a/32.png) [@jaynick](https://discourse.julialang.org/u/jaynick)\
**Post date:** [January 7, 2020, 5:46am UTC](https://discourse.julialang.org/t/alarming-incorrect-computation-in-flux-juno/33017/6 "2020-01-07T05:46:16Z")

</div>

I posted about this at  
[https://discourse.julialang.org/t/seriously-incorrect-computation-in-juno-repl/33050](https://discourse.julialang.org/t/seriously-incorrect-computation-in-juno-repl/33050)  
because it seems (to me) to be a problem in Juno, maybe.

---

<div class="post-metadata">

**Author:** ![jaynick](https://avatars.discourse-cdn.com/v4/letter/j/71c47a/32.png) [@jaynick](https://discourse.julialang.org/u/jaynick)\
**Post date:** [January 7, 2020, 6:23pm UTC](https://discourse.julialang.org/t/alarming-incorrect-computation-in-flux-juno/33017/7 "2020-01-07T18:23:43Z")

</div>

Further discussion at the bottom of [https://github.com/FluxML/Flux.jl/issues/982](https://github.com/FluxML/Flux.jl/issues/982)  
it is caused by multithreading, not Juno
