mlem icon indicating copy to clipboard operation
mlem copied to clipboard

Local env may require the same package versions as in `.mlem` file for build

Open aguschin opened this issue 2 years ago • 3 comments

error at deploying model:

ValueError: Conflicting versions for package numpy: 1.21.6 and 1.23.5 (model saved in one place, getting deployed from some mlem env with numpy 1.23.5)

I got this when I trained a model on one env, but then started deploying it in another env. I assumed we won't check this (and that we even don't need numpy installed in this case). So: we should work around this and don't require numpy installed as well.

How to repro (rough draft, ping me if this doesn't reproduce):

pip install numpy==1.21.6

import mlem

def f(x):
    import numpy
    return x

mlem.api.save(f, "model", sample_data=1)

now:

$ pip install numpy==1.23.5
$ mlem deploy run flyio ...  # but maybe `mlem build docker` will work

aguschin avatar Mar 13 '23 08:03 aguschin

@aminalaee, while we're waiting on the answer on the other issue, could you please TAL at this one? I believe this is an important one. This could require some dive, but happy to help investigating. Happy to also clarify the issue if it's not explained clearly.

aguschin avatar Apr 25 '23 12:04 aguschin

@aguschin I couldn't reproduce this issue. Maybe some steps for reproducing are missing or the issue is resolved?

aminalaee avatar Apr 26 '23 08:04 aminalaee

Hmm, interesting. I'll try to reproduce this again and post it. Ironically, I'm blocked by #661, but not sure if you can fix that one - reproducing it will require having at least two orgs on fly. Should be easy to fix I assume - probably we don't supply right option to flyctl launch

On the second thought - I can add you to my org, then you'll be in 2 orgs at the same time - and the issue will be reproduced. Please ping me if you would like to check that one out while I'm reproducing this one. To invite you, I'll need your email, so you can send it to me to [email protected] or https://t.me/agusch1n

aguschin avatar Apr 26 '23 11:04 aguschin