Giter VIP home page Giter VIP logo

Comments (5)

randommm avatar randommm commented on May 28, 2024

I also had this problem using Rstan 1.3 stable, but it worked fine using the latest revision of Github master branch.

from stan.

bob-carpenter avatar bob-carpenter commented on May 28, 2024

I just verified that this crashes in the most recent
RStan either in debug or fast mode. I don't even get
an error message, the R process crashes and the GUI disappears.
(I'm on: R 2.15.3 GUI 1.53 Leopard build 64-bit (6451))

This model runs without crashing or providing warnings
from the command line on the current master branch.
Printing out the product it looks OK.

Oh, and it's not the data. I changed that to transformed
data and made the num==5 so I could inspect the product
and it still crashed R.

  • Bob

On 5/1/13 5:20 AM, Paul Metcalfe wrote:

This is a minimal version of a problem that has caught me in a real model. This model:

|data {
int<lower=0> num;
}

parameters {
vector<lower=0, upper=1>[num] scale;
matrix[num, num] fred;
}

transformed parameters {
matrix[num, num] out;

 out <- diag_pre_multiply(scale, fred);

}

model {
for (indx in 1:num) {
for (indy in 1:num) {
fred[indy, indx] ~ normal(0, 1);
}
}
}
|

dies with the error

|/home/pdm/.R/x86_64-unknown-linux-gnu/2.15/rstan/include//stanlib/eigen_3.1.2/Eigen/src/Core/DenseCoeffsBase.h:337: typename Eigen::internal::traits::Scalar& Eigen::DenseCoeffsBase<Derived, 1>::operator()(typename Eigen::internal::traits::Index, typename Eigen::internal::traits::Index) [with Derived = Eigen::Matrix<stan::agrad::var, -0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001, -0x00000000000000001>]: Assertion `row >= 0 && row < rows() && col >= 0 && col < cols()' failed.
Aborted (core dumped)
|

when run with

|library(rstan)

set_cppo("debug")

results <-
stan(file="dummy.txt",
data=list(num=100),
iter=1000,
chains=4)
|

The R version is 2.15.1, Rcpp is 0.10.3, gcc is

|Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla
--enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release
--with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions
--enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada
--enable-java-awt=gtk --disable-dssi
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile
--enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar
--disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686
--build=x86_64-redhat-linux
Thread model: posix
gcc version 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC)
|

and rstan is

|rstan (Version 1.3.0, packaged: 2013-04-12 21:12:02 UTC, GitRev: f574555)
|

The OS is linux amd64.


Reply to this email directly or view it on GitHub #34.

from stan.

randommm avatar randommm commented on May 28, 2024

I'm using a modified makefile to compile Rstan, so, this might be the reason it worked for me (I tried the model again and it worked):

I changed:
$(R) CMD rstan --md5 # --no-vignettes --no-manual
with
$(R) CMD build /home/marco/Documents/stan/rstan/rstan --md5 --no-vignettes --no-manual

And:
$(R) CMD INSTALL --merge-multiarch $(STANPKG)
with
$(R) CMD INSTALL --no-multiarch rstan_1.3.0.tar.gz

Maybe this is a clue. I'll trying using the default makefile and see if it runs. My OS is also Linux amd64.

EDIT: I wasn't able to reproduce this problem using the latest revision of Github master branch even after using the default makefile.

from stan.

maverickg avatar maverickg commented on May 28, 2024

If we use the current master branch, I think both stan from the command
line or rstan work. But using Stan 1.3.0 that we released, we have the same problem
as with RStan 1.3.0 that we released. So I do not think this is a problem with
RStan. This is the result of using stan-1.3.0 downloaded from mc-stan.org:

jq2@jq-tpw510:~/Desktop/stan-src-1.3.0/tmp$ more m1.stan

data {
int<lower=0> num;
}

parameters {
vector<lower=0, upper=1>[num] scale;
matrix[num, num] fred;
}

transformed parameters {
matrix[num, num] out;

out <- diag_pre_multiply(scale, fred);

}

model {
for (indx in 1:num) {
for (indy in 1:num) {
fred[indy, indx] ~ normal(0, 1);
}
}
}
jq2@jq-tpw510:~/Desktop/stan-src-1.3.0/tmp$ ./m1 --data=m1.rdump
m1: lib/eigen_3.1.2/Eigen/src/Core/DenseCoeffsBase.h:337: Eigen::DenseCoeffsBase<Derived, 1>::Scalar& Eigen::DenseCoeffsBase<Derived, 1>::operator()(Eigen::DenseCoeffsBase<Derived, 1>::Index, Eigen::DenseCoeffsBase<Derived, 1>::Index) [with Derived = Eigen::Matrix<stan::agrad::var, -1, -1>; Eigen::DenseCoeffsBase<Derived, 1>::Scalar = stan::agrad::var; Eigen::DenseCoeffsBase<Derived, 1>::Index = long int]: Assertion `row >= 0 && row < rows() && col >= 0 && col < cols()' failed.
Aborted

Jiqiang

from stan.

pdmetcalfe avatar pdmetcalfe commented on May 28, 2024

I guess the fix was 405bc3d ?

Thanks for the very wonderful stan!

from stan.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.