aleximmer / Laplace

Laplace approximations for Deep Learning.
https://aleximmer.github.io/Laplace
MIT License
432 stars 61 forks source link

Mismatching pip installation and website documentation? #191

Closed MJordahn closed 1 month ago

MJordahn commented 1 month ago

Hi Laplace Developers!

I am not entirely sure if I am doing some incorrect installation wise, but as of yesterday when I install your package via pip pip install laplace-torch I get a different version than the one that is currently available both here on GitHub and on your documentation website. I know this because the function RunningNLLMetric() is not available in the old version.

I can fix this for myself, but thought that it was perhaps of interest for you to know.

Many thanks

wiseodd commented 1 month ago

Yes, currently the main branch is still in a pre-release stage and thus not been uploaded to the pip repo yet. This should be done by the end of this month. We're waiting for all the open pull requests to be merged.

https://github.com/aleximmer/Laplace/milestone/2

wiseodd commented 1 month ago

For now, please install it from the main branch:

pip install git+https://git@github.com/aleximmer/laplace
MJordahn commented 1 month ago

Cool - thanks very much for the swift reply!

MJordahn commented 3 weeks ago

Hello again,

I have now tried using installing from the dev branch above, which works fine upon installation (locally), but I run into dependency conflicts when later trying to install from a requirements file generated by running pip freeze. The error I get is the following:

INFO: pip is looking at multiple versions of laplace-torch to determine which version is compatible with other requirements. This could take a while.

The conflict is caused by:
    The user requested asdl 0.1 (from git+https://github.com/kazukiosawa/asdl@011a942b2698b9ec33b0c8c47c96bd49335e5d80)
    laplace-torch 0.1a2 depends on asdl 0.1 (from git+https://github.com/kazukiosawa/asdl)

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

My requirements file contains the following lines after installing from Git:

asdl @ git+https://github.com/kazukiosawa/asdl@011a942b2698b9ec33b0c8c47c96bd49335e5d80
curvlinops-for-pytorch @ git+https://github.com/f-dangel/curvlinops@d509cd6c332cda0e3bbb7b6bd9c5f37a6aa023b1
laplace-torch @ git+https://git@github.com/aleximmer/laplace@d969f659d3cfad250874d29dc9c92484130a6846

My expertise in the environment management area is limited, so it is possible that I am doing something wrong here. I tried alternatively using pip list --format freeze, but this just points directly to the 0.1a2 version of Laplace rather than the Git version.

I am able to find a solution to this myself although hacky, but nevertheless thought that I would make you aware of this issue (although, once again, it is not unlikely it is me causing the error).

wiseodd commented 3 weeks ago

Yeah I think it's because of pip... What I usually do is to put the manual installation procedure in the README of my project. E.g. https://github.com/wiseodd/laplace-bayesopt?tab=readme-ov-file#installation