Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A problem when press the Analyze button #30

Open
zddzxxsmile opened this issue Mar 16, 2022 · 6 comments
Open

A problem when press the Analyze button #30

zddzxxsmile opened this issue Mar 16, 2022 · 6 comments
Assignees

Comments

@zddzxxsmile
Copy link

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:

era_start

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)
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 229)
Checking the installed version of MatlabStan is not currently supported

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.

@peclayson peclayson self-assigned this Apr 2, 2022
@peclayson
Copy link
Owner

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

@armenbagdasarov
Copy link

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.

  • I downloaded cmdstan-2.29.2.tar.gz. Though when I go into the Terminal, cd into the folder, and then type ls, I have a slightly different output printed than what in the manual.

Jenkinsfile install-tbb.bat src
LICENSE lib stan
README.md make test-all.sh
bin makefile
examples runCmdStanTests.py

  • I typed make build -j8 and after about 30 seconds got the output: CmdStan v2.29.2 built
  • I downloaded the MatlabProcessManager.
  • I downloaded MatlabStan and edited the stan_home.m script.
  • I added the new directories to the Matlab path.

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:

  • cmdstan-2.29.2
  • MatlabProcessManager-0.4.2
  • MatlabStan-2.7.0.0
  • peclayson-ERA_Toolbox-e458a8c

I am using MATLAB R2022a.

@peclayson
Copy link
Owner

You can try the more robust fix for the version checking here: brian-lau/MatlabStan#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!

@armenbagdasarov
Copy link

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!

@peclayson
Copy link
Owner

No worries! I'm glad we got it worked out.

Please let me know if you have any other questions/problems!

@yanxinyupsy
Copy link

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_stan_version_ (line 931)
ver = cellfun(@str2num,regexp(str{3},'.','split'));

Error in StanModel/get_stan_version (line 898)
ver = self.get_stan_version_();

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants