Open zddzxxsmile opened 2 years ago
Can you try downloading the development version here?
It looks like the version number is not getting fixed during the installation of MatlabStan.
If you manually change line 850 in MatlabStan-2.15.10/StanModel.m from
ver = cellfun(@str2num,regexp(str{3},'.','split'));
to
ver = '2.26.1';
You should be good to go. Let me know if that works for you.
-Peter
Hi Peter! I am having the same issues as zddzxxsmile. Any help would be much appreciated. Thanks! See below for details.
I am following the Mac Installation Instructions. When I get to g++ --version to verify that the g++ version is at version 4.2.1 or later, I get something different than what is in the manual.
armenbagdasarov@Armens-MacBook-Pro ~ % g++ --version Apple clang version 13.1.6 (clang-1316.0.21.2.5) Target: arm64-apple-darwin21.3.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
I do see a file called g++ in /Applications/Xcode.app/Contents/Developer/usr/bin/, but it is an alias for a file called gcc.
Still I proceeded with the next steps.
Jenkinsfile install-tbb.bat src LICENSE lib stan README.md make test-all.sh bin makefile examples runCmdStanTests.py
When I run era_start.m, the first message I get in the GUI is: You are using old version(s) of MatlabProcessManager. It is recommended that you update the toolbox. Would you like to do so now? WARNING: Doing so will delete the old directories for the dependents to avoid confusion.
I hit No.
There are also a few warnings in the Command Window:
Ensuring dependents are found in the Matlab path ERA Toolbox files found CmdStan, MatlabProcessManager, and MatlabStan files found Warning: Installed CmdStan version is newer than the version tested for the Toolbox. Toolbox may not work properly as a result
In era_start (line 218) There is a new version of MatlabProcessManager available Checking the installed version of MatlabStan is not currently supported
ERP Reliability Analysis Toolbox Version 0.5.3
Warning: You are running a non-stable release of the toolbox
In era_updatecheck (line 105) In era_start (line 245) You likely cloned github, rather than installed the latest stable release As a result, complete functionality cannot be guaranteed The lastest stable release can be downloaded at Github
Dependents will not be updated
For now things seem to be working (as in there are warning, but no errors yet). I uploaded my file, entered the correct parameters, and pressed Analyze. I know that my file and inputs are correct because I have actually used your toolbox on my old Mac and it worked like a charm. I recently bought a new Mac and am trying to get your toolbox to work on my new one. Sadly, I am having problems with getting it to work on my new Mac as it did perfectly on my old one.
Here's the error:
Preparing data for analysis...
Model is being run in cmdstan
This may take a while depending on the amount of data Having a problem getting stan version. This is likely a problem with Java running out of file descriptors Trying again. Trying again. Trying again. Trying again. Trying again. Trying again. Giving up. Error using cellfun Non-scalar in Uniform output, at index 1, output 1. Set 'UniformOutput' to false.
Error in StanModel/stan_version (line 796) ver = cellfun(@str2num,regexp(str{3},'.','split'));
Error in StanModel (line 194) ver = self.stan_version();
Error in stan (line 108) model = StanModel();
Error in era_computerel (line 928) fit = stan('model_code', stan_in,...
Error in era_computerelwrap (line 187) REL = era_computerel('data',era_data.proc.data,...
Error in era_startproc>era_exec (line 1570) era_data = era_computerelwrap('era_prefs',era_prefs,'era_data',era_data);
Error while evaluating DestroyedObject Callback.
Following the instructions in your comment from April 2, I downloaded the development version: peclayson-ERA_Toolbox-e458a8c
I changed line 796 in MatlabStan-2.7.0.0/StanModel.m from ver = cellfun(@str2num,regexp(str{3},'.','split')); to ver = '2.7.0.0';
When I run era_start.m again, the first message I get in the GUI is again You are using old version(s) of MatlabProcessManager. It is recommended that you update the toolbox. Would you like to do so now? WARNING: Doing so will delete the old directories for the dependents to avoid confusion.
This time when pressing Analyze the error messages are:
Loading Data... This may take awhile depending on the amount of data...
Error using matlab.ui.internal.dialog.FileSystemChooser/PathParser Invalid directory to operate on
Error in matlab.ui.internal.dialog.FileSystemChooser/set.InitialPathName (line 32) iPath = PathParser(obj,iPath);
Error in uigetputfile_helper (line 86) ufd.InitialPathName = dialog_pathname;
Error in uiputfile (line 117) [filename, pathname, filterindex] = uigetputfile_helper(1, varargin{:});
Error in era_startproc>era_exec (line 1530) [era_data.proc.savename, era_data.proc.savepath] = uiputfile(...
Error while evaluating DestroyedObject Callback.
Here are the versions of everything I have in my ERADependents folder:
I am using MATLAB R2022a.
You can try the more robust fix for the version checking here: https://github.com/brian-lau/MatlabStan/issues/61
Can you also try to run the eight schools example? (code below) We need to pinpoint where the problem is.
One thing you might try is to take the dependents off the MATLAB path and then let the toolbox instal them.
schools_code = {
'data {'
' int<lower=0> J; // number of schools '
' real y[J]; // estimated treatment effects'
' real<lower=0> sigma[J]; // s.e. of effect estimates '
'}'
'parameters {'
' real mu; '
' real<lower=0> tau;'
' real eta[J];'
'}'
'transformed parameters {'
' real theta[J];'
' for (j in 1:J)'
' theta[j] <- mu + tau * eta[j];'
'}'
'model {'
' eta ~ normal(0, 1);'
' y ~ normal(theta, sigma);'
'}'
};
schools_dat = struct('J',8,...
'y',[28 8 -3 7 -1 1 18 12],...
'sigma',[15 10 16 11 9 11 10 18]);
fit = stan('model_code',schools_code,'data',schools_dat);
print(fit);
eta = fit.extract('permuted',true).eta;
mean(eta)
Let me know how this goes. Good luck!
Wow, I have previously tried letting the toolbox install dependents itself twice and wasn't able to. I just tried again and it worked. Strange, but this is fantastic news. Thanks for the help, Peter!
No worries! I'm glad we got it worked out.
Please let me know if you have any other questions/problems!
Hello Dr. Clayson,
I have encountered similar issues as zddzxxsmile and would greatly appreciate your assistance.
Here are the details:
Versions of Tools in My ERADependencies Folder: cmdstan-2.35.0 MatlabProcessManager-Master MatlabStan-Master ERP Reliability Analysis Toolbox Version 0.4.8
I am using MATLAB R2019a.
Steps and Issues: (1)After installing Rtools 4.4, I couldn't find g++ and make through the command prompt. Following the manual, I reinstalled Rtools 3.3, which allowed me to access g++ and make, but I still couldn't install cmdstan. (2)Consequently, I used R to install cmdstan in the path D:\ERAdependencies. (3)I downloaded the MatlabProcessManager. (4)I downloaded MatlabStan and edited the stan_home.m script accordingly. (5)I added the new directories to the Matlab path. However, when I ran era_start.m, I encountered the following errors:
Ensuring dependents are found in the Matlab path ERA Toolbox files found CmdStan, MatlabProcessManager, and MatlabStan files found Warning: Installed CmdStan version is newer than the version tested for the Toolbox. Toolbox may not work properly as a result
In era_start (line 209) Warning: Installed MatlabProcessManager version is newer than the version tested for the Toolbox. Toolbox may not work properly as a result In era_start (line 220) Checking the installed version of MatlabStan is not currently supported
ERP Reliability Analysis Toolbox Version 0.4.8 Unable to connect to Github to check for new releases Loading Data... This may take awhile depending on the amount of data... Preparing data for analysis... Model is being run in cmdstan This may take a while depending on the amount of data Having a problem getting stan version. This is likely a problem with Java running out of file descriptors Trying again. Trying again. Trying again. Trying again. Trying again. Trying again. Giving up. You can try setting the Stan version explicitly using the stan_version attribute. i.e. StanModel.stan_version = [2 15 0] Error using cellfun Non-scalar in Uniform output, at index 1, output 1. Set 'UniformOutput' to false.
Error in StanModel/get_stanversion (line 931) ver = cellfun(@str2num,regexp(str{3},'.','split'));
Error in StanModel/get_stan_version (line 898) ver = self.get_stanversion();
Error in StanModel (line 198) self.stan_version = self.get_stan_version();
Error in stan (line 108) model = StanModel();
Error in era_computerel (line 576) fit = stan('model_code', stan_in, 'model_name', modelname,...
Error in era_computerelwrap (line 168) REL = era_computerel('data',era_data.proc.data,...
Error in era_startproc>era_exec (line 1184) era_data = era_computerelwrap('era_prefs',era_prefs,'era_data',era_data);
Error while evaluating DestroyedObject Callback.
And then based on your reply to zddzxxsmile, I manually changed line 931 in MatlabStan-master /StanModel.m from
ver = cellfun(@str2num,regexp(str{3},'.','split'));
to ver = '2.26.1';
This change made it work, but new errors have appeared since then.
Ensuring dependents are found in the Matlab path ERA Toolbox files found CmdStan, MatlabProcessManager, and MatlabStan files found Warning: Installed CmdStan version is newer than the version tested for the Toolbox. Toolbox may not work properly as a result
In era_start (line 209) Warning: Installed MatlabProcessManager version is newer than the version tested for the Toolbox. Toolbox may not work properly as a result In era_start (line 220) Checking the installed version of MatlabStan is not currently supported
ERP Reliability Analysis Toolbox Version 0.4.8
Unable to connect to Github to check for new releases
Loading Data... This may take awhile depending on the amount of data...
Preparing data for analysis...
Model is being run in cmdstan
This may take a while depending on the amount of data
Compile failed with exit value: 2
Error using StanModel/compile (line 1013)
makefile:74: Extraneous text after else' directive stan/lib/stan_math/make/compiler_flags:129: Extraneous text after
else' directive
stan/lib/stan_math/make/compiler_flags:134: Extraneous text after else' directive stan/lib/stan_math/make/compiler_flags:134: *** only one
else' per conditional. Stop.
Error in StanModel/sampling (line 778) self.compile('model');
Error in stan (line 146) fit = model.sampling(p.Unmatched);
Error in era_computerel (line 576) fit = stan('model_code', stan_in, 'model_name', modelname,...
Error in era_computerelwrap (line 168) REL = era_computerel('data',era_data.proc.data,...
Error in era_startproc>era_exec (line 1184) era_data = era_computerelwrap('era_prefs',era_prefs,'era_data',era_data);
Error while evaluating DestroyedObject Callback.
I would greatly appreciate any guidance or solutions you could provide to resolve these new issues.
Thank you very much for your time and assistance.
Hello Dr. Clayson,
I am interested in conducting dependability estimates on my data. I have formatted my data correctly and have downloaded the most recent dependents you list in the user manual for the ERA toolbox (i.e., MatlabStan (v 2.15.1.0), CmdStan (v 2.29.1), and MatlabProcessManager-master. I am using MatLab R2018b with a Win10 system. After entering "era_start" and press the Analyze button, I receive the following output:
Ensuring dependents are found in the Matlab path ERA Toolbox files found CmdStan, MatlabProcessManager, and MatlabStan files found Warning: Installed CmdStan version is newer than the version tested for the Toolbox. Toolbox may not work properly as a result
ERP Reliability Analysis Toolbox Version 0.5.2
You are running the most up-to-date version of the toolbox
Loading Data... This may take awhile depending on the amount of data...
Preparing data for analysis...
Model is being run in cmdstan
This may take a while depending on the amount of data Having a problem getting stan version. This is likely a problem with Java running out of file descriptors Trying again. Trying again. Trying again. Trying again. Trying again. Trying again. Giving up. Error using cellfun Non-scalar in Uniform output, at index 1, output 1. Set 'UniformOutput' to false.
Error in StanModel/stan_version (line 850) ver = cellfun(@str2num,regexp(str{3},'.','split'));
Error in StanModel (line 196) ver = self.stan_version();
Error in stan (line 108) model = StanModel();
Error in era_computerel (line 477) fit = stan('model_code', stan_in,...
Error in era_computerelwrap (line 178) REL = era_computerel('data',era_data.proc.data,...
Error in era_startproc>era_exec (line 1565) era_data = era_computerelwrap('era_prefs',era_prefs,'era_data',era_data);
Error while evaluating DestroyedObject Callback.