brian-j-smith / Mamba.jl

Markov chain Monte Carlo (MCMC) for Bayesian analysis in julia
Other
253 stars 52 forks source link

StackOverflowError from combined use of Mamba.jl and Distributions.jl #166

Closed RoyCCWang closed 4 years ago

RoyCCWang commented 4 years ago

Distributions.jl and Mamba.jl aren't playing nice on my machine. Here is a demonstrative code that reproduces the error:

import Random
import Distributions
using Mamba

Random.seed!(25)

D = 2

m = randn(Float64, D)
P = randn(Float64, D, D)
P = P'*P

dist_x = Distributions.MvNormal(m, P)

Error is:

ERROR: LoadError: StackOverflowError:
Stacktrace:
 [1] MvNormal(::Array{Float64,1}, ::Array{Float64,2}) at /home/roy/.julia/packages/Mamba/Jotzr/src/distributions/constructors.jl:19
in expression starting at /home/roy/Documents/repo/gaussianparticleflow/fresh/stackoverflow.jl:24

I'm using Mamba v0.12.2, Distributions v0.23.1. Version information:

Julia Version 1.4.0
Commit b8e9a9ecc6 (2020-03-21 16:36 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: AMD Ryzen 7 1700 Eight-Core Processor
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-8.0.1 (ORCJIT, znver1)
brian-j-smith commented 4 years ago

Hi, there is a recent commit in the master branch that may take care of this error. See if checking out the master branch with Pkg.develop("Mamba") helps. If so, I'll plan on making a new package release.

RoyCCWang commented 4 years ago

There are no errors when I use the developmental branch. Please close this issue once you push it as a main release. Thanks!

brian-j-smith commented 4 years ago

Mamba 0.12.3 is now released with the changes.

ajiwahyu commented 4 years ago

Hi Brian

So when i tried this https://github.com/nsgrantham/mimix I keep getting this error. As suggested, I have used both the development version and release version of Mamba 0.12.4 but this error kept popping up.

ERROR: LoadError: StackOverflowError: Stacktrace: [1] MvNormal(::Array{Float64,2}) at /Users/IBRC/.julia/packages/Mamba/XIznA/src/distributions/constructors.jl:19 (repeats 79984 times) in expression starting at /Users/IBRC/mimix/scripts/sim-mcmc.jl:164

Aji

brian-j-smith commented 4 years ago

Hi @ajiwahyu,

I've pushed a commit to the master (development) branch that should fix the MvNormal overflow error. Let me know if that solves the issue for you.

ajiwahyu commented 4 years ago

Thanks @brian-j-smith

I will try, update you on this.

Aji