Giter Site home page Giter Site logo

Comments (5)

foolnotion avatar foolnotion commented on August 16, 2024 1

Thanks for the report. That's because the module you see in the build folder is an internal module (that's why it's called _operon) that binds the methods from the C++ library almost 1:1. The internal module is wrapped by a pure python module operon which additionally provides the sklearn estimator.

Normally, you would provide an install prefix with -DCMAKE_INSTALL_PREFIX=/path/to/module and then run make install when the build is done. /path/to/module should be in the PYTHONPATH so python can pick it up.

I can update the install script but I would need to know where you want it installed.

EDIT: also, if you don't provide an install prefix the CMake script will try to figure out your python library path and install the module there (in this case it might be necessary to sudo make install). The install script will copy the dll and the pure python module from here into your desired install folder.

from operon.

lacava avatar lacava commented on August 16, 2024

Operon should end up in $CONDA_PREFIX/lib/python3.9/site-packages. I just tried providing this as an argument to -DCMAKE_INSTALL_PREFIX with no luck. I also tried creating a test_dir in the operon directory and specifying that, but no files were copied there. I do see the line "-- Python bindings will be installed in /path/to/operon/test_dir" during Cmake build, so maybe it is failing silently.

Could be nice to have the python module install as a python package using a minimal setup.py script and a call to python setup.py install.

from operon.

foolnotion avatar foolnotion commented on August 16, 2024

This install script works on my ubuntu machine. It seems that CMake is able to detect the correct library path, so I'd recommend omitting CMAKE_INSTALL_PREFIX option so that we don't hardcode the python version.

The module import failure was caused by a name conflict, the file regression-benchmark/experiment/methods/operon.py should be renamed to something else like OperonRegressor.py.

# Installing operon
export CC=gcc-9
export CXX=gcc-9
# Dependencies 
# - TBB - installed via conda
# - Eigen- installed via conda
# - Ceres- installed via conda
# - {fmt}- installed via conda

git clone https://github.com/heal-research/operon
cd operon
git checkout 79617d76c97838d91293cff5d4e4fda7230b904b
# run cmake
mkdir build; cd build; 
cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_PYBIND=ON -DUSE_OPENLIBM=ON -DUSE_SINGLE_PRECISION=ON -DCERES_TINY_SOLVER=ON

# build
make VERBOSE=1 -j pyoperon

# install
make install

After configuring and installing and renaming the regressor, I was actually able to run a small experiment:

time python evaluate_model.py -ml OperonRegressor Poly-10.csv -seed 1234 -results_path ./results/

from operon.

lacava avatar lacava commented on August 16, 2024

ah ok. Adding make VERBOSE=1 -j pyoperon; make install worked like a charm. and i've fixed the name conflict. Would be good to get this in the documentation. Thank you!

from operon.

foolnotion avatar foolnotion commented on August 16, 2024

Thanks! Just one last thing: it's maybe better to not fix the revision number in the install script, (at least not right now) since there are still some minor issues in the sklearn wrapper that need to be ironed out.

from operon.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.