ExaScience / smurff

Bayesian Factorization with Side Information in C++ with Python wrapper
MIT License
70 stars 14 forks source link

Could not load PredictSession #115

Closed thanhlv closed 6 years ago

thanhlv commented 6 years ago

The errors were very different for different SMURFF versions.

1) Smurff version v0.12.4-120-gd9c235d3

import smurff predictor = smurff.PredictSession.fromRootFile('root.ini') Traceback (most recent call last): File "", line 1, in AttributeError: type object 'PredictSession' has no attribute 'fromRootFile'

2) Smurff from conda. (Now I cannot get its version bs of the following error: smurff: error while loading shared libraries: libboost_system.so.1.65.1: cannot open shared object file: No such file or directory)

import smurff

predictor = smurff.PredictSession.fromRootFile('root.ini') Traceback (most recent call last): File "", line 1, in File "/home/tlevan3/anaconda3/envs/smurff-imec/lib/python3.6/site-packages/smurff/predict.py", line 137, in fromRootFile cp = HeadlessConfigParser(root_file) File "/home/tlevan3/anaconda3/envs/smurff-imec/lib/python3.6/site-packages/smurff/predict.py", line 48, in init read_string(self.cp, content) File "/home/tlevan3/anaconda3/envs/smurff-imec/lib/python3.6/site-packages/smurff/predict.py", line 25, in read_string return cp.read_string(str) File "/home/tlevan3/anaconda3/envs/smurff-imec/lib/python3.6/configparser.py", line 723, in read_string self.read_file(sfile, source) File "/home/tlevan3/anaconda3/envs/smurff-imec/lib/python3.6/configparser.py", line 718, in read_file self._read(f, source) File "/home/tlevan3/anaconda3/envs/smurff-imec/lib/python3.6/configparser.py", line 1066, in _read lineno) configparser.DuplicateSectionError: While reading from '' [line 7]: section 'steps' already exists

tvandera commented 6 years ago

As for 1), indeed the Python interface has changed. Please use smurff 0.12.3 for the moment.

tvandera commented 6 years ago

As for 2): there is a bug in the conda package. As a workaround, please conda install libboost=1.65.

tvandera commented 6 years ago

As for this error:

configparser.DuplicateSectionError: While reading from '' [line 7]: section 'steps' already exists

This is an error in the root.ini file. Please remove the duplicate section [steps]:

[options]
options = options.ini

[steps]

[steps]
checkpoint_step_1 = checkpoint-1-step.ini
checkpoint_step_2 = checkpoint-2-step.ini