ekirving / qpbrute

Heuristic search algorithm for fitting qpGraph models
MIT License
9 stars 3 forks source link

Problems with running qpbayes.py #7

Closed biopitch closed 3 years ago

biopitch commented 4 years ago

Dear Evan,

I have successfully run qpbrute.py and currently trying to run qpbayes.py on the output. However, I keep getting this error:

RuntimeError: Warning message:
package 'coda' was built under R version 3.6.3 
Error: package or namespace load failed for 'fitR' in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/home/user/anaconda3/envs/qpbrute/lib/R/library/stringi/libs/stringi.so':
  libicui18n.so.64: cannot open shared object file: No such file or directory
In addition: Warning message:
package 'deSolve' was built under R version 3.6.3 
Execution halted

I have installed qpbrute using the environment.yaml file provided. R 3.6.1 does not allow me to manually install 'fitR' saying that it is not supported. Any ideas on how to tackle this?

ekirving commented 4 years ago

I'm not sure why it's not working from the conda build, but you can trying installing fitR manually via the following commands.

install.packages("devtools") library(devtools) install_github("sbfnk/fitR")

The package is not on CRAN, so the normal install.packages() will not work.

biopitch commented 4 years ago

Thanks for the quick reply and for pointing me in the right direction.

Here are the problems and the solutions if others encounter the same issue.

  1. I couldn't install fitR using the commands given due to installing r-base via the conda environment. I get an error with untar: In utils::untar(tarfile, ...) : ..... returned error code 127 This is solved by setting the tar environment export TAR=/bin/tar

  2. I still get an error with deSolve.

    * installing *source* package 'fitR' ...
    ** using staged installation
    ** R
    ** data
    *** moving datasets to lazyload DB
    ** inst
    ** byte-compile and prepare package for lazy loading
    Error: (converted from warning) package 'deSolve' was built under R version 3.6.3
    Execution halted
    ERROR: lazy loading failed for package 'fitR'
    * removing '/home/user/anaconda3/envs/qpbrute/lib/R/library/fitR'
    * restoring previous '/home/user/anaconda3/envs/qpbrute/lib/R/library/fitR'
    Error: Failed to install 'fitR' from GitHub:
    (converted from warning) installation of package '/tmp/RtmpqErKl9/file1d6373793d84/fitR_0.1.tar.gz' had non-zero exit status

    This is an easy fix with install.packages("deSolve")

  3. Finally succeeded in installing fitR by running devtools::install_github("sbfnk/fitR") as suggested.

Thanks so much!

biopitch commented 3 years ago

Dear Evan,

Pardon for reopening this issue. I met with another error when running qpbayes. It was running for each of graphs perfectly until the now. I got an error:

RuntimeError: Warning message: package ‘coda’ was built under R version 3.6.3 Warning message: package ‘data.table’ was built under R version 3.6.3 There were 50 or more warnings (use warnings() to see the first 50) Error in[.data.frame(setDF(tail(chain.prev, 1)), mcmc$parameter_names) : undefined columns selected Calls: run_chain -> [ -> [.data.frame In addition: Warning message: In fread(fullchain.file, header = T, sep = ",") : File 'bayes/gal01-2de83a2-chain-1.csv' has size 0. Returning a NULL data.table. Execution halted

I am not really sure why it suddenly gives an error when it calculated only 263 graphs without issues. I have 378 graphs in total. Any ideas on why this is happening?

ekirving commented 3 years ago

That error message indicates that the chain file bayes/gal01-2de83a2-chain-1.csv already exists, but for some unknown reason it is empty. My best guess here is that an earlier run of this model was stopped before it could write any data?

Anyway, I've pushed a small change to git with an explicit check to make sure that no error is thrown when the chain file is empty.

Please try again and let me know if it works.

biopitch commented 3 years ago

Dear Evan,

That is exactly the case, it's working now. Thank you!