# Error when trying to run /FluxML/model-zoo/vision/vae\_mnist/vae\_mnist.jl on newer versions of CUDA, Flux

**URL:** https://discourse.julialang.org/t/error-when-trying-to-run-fluxml-model-zoo-vision-vae-mnist-vae-mnist-jl-on-newer-versions-of-cuda-flux/68300
**Category:** Machine Learning
**Tags:** question, cuda, flux, zygote
**Created:** [September 17, 2021, 2:51am UTC](https://discourse.julialang.org/t/error-when-trying-to-run-fluxml-model-zoo-vision-vae-mnist-vae-mnist-jl-on-newer-versions-of-cuda-flux/68300 "2021-09-17T02:51:49Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![tylerjthomas9](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tylerjthomas9/32/44878_2.png) [@tylerjthomas9](https://discourse.julialang.org/u/tylerjthomas9)
#### Post date: [September 17, 2021, 2:51am UTC](https://discourse.julialang.org/t/error-when-trying-to-run-fluxml-model-zoo-vision-vae-mnist-vae-mnist-jl-on-newer-versions-of-cuda-flux/68300/1 "2021-09-17T02:51:50Z")

</div>

I’m trying to run the file found here: [https://github.com/FluxML/model-zoo/blob/master/vision/vae\_mnist/vae\_mnist.jl](https://github.com/FluxML/model-zoo/blob/master/vision/vae_mnist/vae_mnist.jl) on newer versions of Flux, CUDA.

CUDA = v3.4.2  
Flux = v0.12.6

Do you know what could be causing errors with getting the loss/gradient? It seems odd that this step is broken.

When I run the example with the latest versions of Flux, CUDA on a gpu, I get the error “ERROR: this intrinsic must be compiled to be called” when the model loss is being calculated.

When I run the example on the cpu, the loss diverges.

Edit:  
Updating Zygote to the latest version on github fixes the GPU error, but the loss still diverges.

---

<div class="post-metadata">

### Author: ![tylerjthomas9](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tylerjthomas9/32/44878_2.png) [@tylerjthomas9](https://discourse.julialang.org/u/tylerjthomas9)
#### Post date: [September 24, 2021, 12:28am UTC](https://discourse.julialang.org/t/error-when-trying-to-run-fluxml-model-zoo-vision-vae-mnist-vae-mnist-jl-on-newer-versions-of-cuda-flux/68300/2 "2021-09-24T00:28:58Z")

</div>

Zygote v0.6.22 fixed this issue
