Comments (28)
Couple of quick checks:
- does ProcessManager work? Try running a couple of the examples here: https://github.com/brian-lau/MatlabProcessManager
- Do you have spaces in any of the directory names?
from matlabstan.
Hi Brian,
- Yes. ProcessManager works (I tried the first two examples you listed, and both are fine.)
- Yes! I now moved cmdstan into a folder that does not contain a space in its name, and MatlabStan runs! Thanks!
(It still gives an error with the 8 schools example, that is now:
Stan is still working. You can either:
- Use the peek method to get partial samples
- Come back later, or
- Attach a listener to the StanFit object.
Attempt to reference field of non-structure array.
Error in school_test (line 31)
eta = fit.extract('permuted',true).eta;
But: I'm not sure if this issue is fatal, and I can think about it. (Ideas?) In any case, thanks a lot for your help!
-- Raghu
from matlabstan.
I suspect that the 8 schools problem is due to the extract method getting called before sampling has finished. This would happen if the entire example was evaluated all at once. See here:
https://github.com/brian-lau/MatlabStan/wiki/Blocking-the-Matlab-command-line
if you want to extract in a script.
from matlabstan.
Hi, I have the "space in path name" problem but because I am running off a second iMac HDD all paths have "Macintosh HD" in them. If I change this it will throw all sorts of things out of kilter. Is there a fix rather than just change/move?
many thanks
Rob Harrison
Sheffield UK
from matlabstan.
Hi Rob
I did not find a simple way to do this. If I recall correctly, I couldn't figure out a way to escape spaces in the command that gets passed through Java.
I think 'Macintosh HD' is just a link to '/', so replacing your references with '/' may solve the problem?
-b
from matlabstan.
Thanks for that Brian but it doesn;t recognise this at all (as below) - at least when I specify /Volumes/Macintosh HD/Users/ ... it gets into the try/catch section. My problem is that I boot and run apps from a SSD and have my user a/c (data etc.) on the HDD so everything needs the full path. Anyway, thanks for the prompt response - I'll keep on hacking!
Rob
Error using StanModel/set.stan_home (line 303)
Can't parse stan_home. Is it set correctly?
Error in StanModel (line 184)
self.stan_home = p.Results.stan_home;
Error in stan (line 108)
model = StanModel();
from matlabstan.
Thanks for developing this amazing tool!
I have the same problem: cmdstan built and working (can use it with Rstan) but Matlab giving the following output
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.
Output argument "ver" (and maybe others) not assigned during call to "StanModel/stan_version".
Error in StanModel (line 194)
ver = self.stan_version();
Error in stan (line 108)
model = StanModel();
I don't have spaces in either the cmdstan install folder nor in the matlab stan folder.
Moreover my startup.m file contains the following line:
addpath C:\Users\grinaldi\Documents\MATLAB\stan
from matlabstan.
Sorry, seems the error output got suppressed?
from matlabstan.
Hi Brian, I've updated my post in case you didn't see!
from matlabstan.
I've seen this problem occasionally, and it seems to be a Java-related issue (java is used for communicating with CmdStan). You may find some clues here:
https://github.com/brian-lau/MatlabProcessManager/wiki/Potential-gotchas#process-fails-to-start
although I don't know how to change things on Windows. If it's not too troublesome, can you try after a restart?
from matlabstan.
Hi everyone,
I’ve tried to install and run MatlabStan (v. 2.7.0; cmdstan 2.14.0; operating system Operating System: Debian GNU/Linux 8 (jessie), Kernel: Linux 3.16.0-4-amd64)
After adding cmstan and ProcesManager (in addition to MatlabStan) to the MATLAB path, I get the same error some have reported before when testing the simple "eight schools" code:
??? Error using ==> StanModel>StanModel.set.stan_home at 311
Does not look like a proper stan setup
Note: ProcessManager runs properly (tested exampleListener & exitHandler(src,data))
Note 2: I edited stan_home.m in +mstan to include the proper directory
d='/home/myusername/eeg/matlab/bayesian/Stan/cmdstan';
Thanks for any advice!
ianthe00
from matlabstan.
Hi,
Can you confirm that running the CmdStan example from the user's guide runs outside of matlab (ie, at the command line)?
-b
from matlabstan.
Hi Brian,
thanks for the quick reply. I proceeded today to follow the cmdstan tutorial (Building cmdstan, compiling and executing a program etc) and it works fine from the command line.
After doing that, I tried again to use stan within MATLAB and now it finds the proper stan setup.
I have however other issues now (with the version of GLIBCXX in libstdc++.so.6) but I can solve this hopefully by using my other linux machine with the current 2016 MATLAB version.
Thanks for your help. So I guess that the issue was that I had not yet properly configured cmdstan from the command line (using make -j4 and so on)? Do you think it would be possible to explicitly mention this requirement here?
https://github.com/brian-lau/MatlabStan/wiki/Getting-Started
Thanks again
from matlabstan.
Hi,
The wiki has been clarified. Regarding the GLIBCXX error, you may find a solution here:
https://github.com/brian-lau/MatlabStan/wiki/Solving-issues-with-GLIBCXX-and-libstdc
Thanks.
from matlabstan.
Thanks so much!
from matlabstan.
I am also having a problem getting started running Stan from Matlab. I compiled cmdstan, but when i try to run any of the examples, I get an error. I have stan_home in /MatlabStan-2.7.0.0/+mstan, and I have the directory in stan_home set to my matlab folder, which also contains cmdstan-2.14.0
I get the following error:
Error using StanModel/set.stan_home (line 311)
Does not look like a proper stan setup
Error in StanModel (line 184)
self.stan_home = p.Results.stan_home;
Error in stan (line 108)
model = StanModel();
from matlabstan.
stan_home should be set to the path where the CmdStan is, which is where you built CmdStan, not necessarily where you put the Matlab files.
from matlabstan.
from matlabstan.
What version of Matlab are you using? Does the eight schools example from the readme run?
from matlabstan.
from matlabstan.
Are you able to run CmdStan examples outside of Matlab?
from matlabstan.
from matlabstan.
from matlabstan.
from matlabstan.
from matlabstan.
I'm also "Having a problem getting stan version" when trying to run the eight schools example. For whatever it's worth, processManager seems to work if I enter
p = processManager('command','nslookup www.google.com');
I'm on Windows 10 and MATLAB 2017b.
Full error readout follows.
Thanks in advance!
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 processManager/start (line 366)
Java exception occurred:
java.io.IOException: Cannot run program "C:\Stan\cmdstan-2.17.1\bin\stanc" (in directory
"N:\docs\Stan\MatlabStan-2.15.1.0"): CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at java.lang.Runtime.exec(Runtime.java:620)
at java.lang.Runtime.exec(Runtime.java:450)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(ProcessImpl.java:386)
at java.lang.ProcessImpl.start(ProcessImpl.java:137)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
... 2 more
Error in processManager/set.command (line 216)
self.start();
Error in processManager (line 181)
self.command = p.Results.command;
Error in StanModel/stan_version (line 843)
p = processManager('id','stanc version','command',command,...
Error in StanModel (line 196)
ver = self.stan_version();
Error in stan (line 108)
model = StanModel();
from matlabstan.
@mfalcy not sure if you ever solved your issue, but I was having a similar problem and none of the above solutions solved it. I managed to localize the issue to line 850 of StanModel.m. It was not appropriately extracting the stanc version, so I just hardcoded it in (ver = '2.21.0') and it works. I'm sure this can be solved much more elegantly so it isn't hard coded.
from matlabstan.
Hello,
I also have the same problem as mfalcy. I have Matlab2019a and Windows10. I did the above recommendations, but none of them work.
I really appreciate if anyone could help me to find the solution.
thanks in advance.
Saideh
from matlabstan.
Related Issues (20)
- Rdump code HOT 1
- All Stan processes finished, but it is still working HOT 4
- Using the .exe from cmdstan in MatlabStan
- Why a model converges using the meanfield algorithm but does not using the fullrank? HOT 1
- struct array assignment problem using MatlabStan output HOT 1
- nansum not defined
- MatlabStan crashes
- Problem if number of observations exceeds number of chains x number of samples
- Matlab (2018a) crashes when trying to save fit HOT 5
- Remove dependence on Statistics or Finance toolbox HOT 1
- Error in StanModel/set.stan_home
- Call Riemannian metric from matlab stan
- pars for specifying parameters to be saved
- Potential solutions for the problems of using MatlabStan in Windows systems HOT 1
- Setting max_depth for NUTS algorithm (maximum treedepth) HOT 1
- could not run examples HOT 4
- Error in checking Stan version & eight schools example HOT 3
- Problem installing cmdstan on Mac HOT 3
- Error in compile when running example rat HOT 1
- Reading Stan fit files (in csv format)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from matlabstan.