Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pin numpy version in run requirements for meta.yml #119

Open
pstjohn opened this issue May 24, 2021 · 12 comments
Open

pin numpy version in run requirements for meta.yml #119

pstjohn opened this issue May 24, 2021 · 12 comments

Comments

@pstjohn
Copy link

pstjohn commented May 24, 2021

Currently, a basic conda-forge environment with python and tensorflow 2.4.1 will pull numpy 1.20.* by default, which isn't compatible.

Would be great if you could add numpy=1.19.* to the run requirements for the meta.yml

@izahn
Copy link

izahn commented May 24, 2021

I'm not sure I understand.

Currently, a basic conda-forge environment with python and tensorflow 2.4.1 will pull numpy 1.20.* by default, which isn't compatible.

Isn't compatible with what?

@pstjohn
Copy link
Author

pstjohn commented May 25, 2021

with tensorflow 2.4.1. The TF team tends to pin numpy versions in their pip releases, and the current meta.yml builds against numpy 1.19.*, but doesn't specify that as a run requirement.

As anecdotal evidence, in the linked PR from my repo, I got a bunch of numpy warnings / errors without pinning numpy, but were fixed when pinning numpy to 1.19.*

@izahn
Copy link

izahn commented May 25, 2021

Good point, maybe this does need a numpy matrix. I'm never really sure about that!

@jakirkham
Copy link
Member

We don't build with NumPy matrices any more (we got rid of these a while back). We just build against the oldest supported NumPy version and let it float above that at runtime. Though this only matters for libraries that link against NumPy

@pstjohn
Copy link
Author

pstjohn commented May 26, 2021

Floating above 1.19.* might be problematic in this case, since using numpy 1.20 at runtime with tensorflow has some known issues tensorflow/tensorflow#47691

@jakirkham
Copy link
Member

Again that comment only pertains to linking NumPy. Idk how TensorFlow uses NumPy so can't say whether that is relevant.

@pstjohn
Copy link
Author

pstjohn commented May 26, 2021

Ah, ok. I suppose to be concrete, I propose changing

- numpy >=1.19

to numpy =1.19

@miketrumpis
Copy link

+1 on this proposal. I just ran into this issue last week. Conda allowed numpy 1.20 to install alongside tensorflow 2.4.1.

Result was this runtime issue: tensorflow/models#9706 (similar to those referenced in tensorflow/tensorflow#47691)

@pstjohn
Copy link
Author

pstjohn commented Oct 1, 2021

Might be trickier now that they've released a 2.6.0 version.
Although I've been getting similar errors with that version, so I had to revert back to pip wheels for some of my CI builds

@h-vetinari
Copy link
Member

The most recent tensorflow builds have all pinned numpy to 1.19 (see also #151 and the linked discussions about numpy compat). Thankfully, TF 2.7. should alleviate this.

In the meantime, is this still an issue for any conda-forge builds in the wild?

@miketrumpis
Copy link

fyi I just had another opportunity to set up a conda-forge tensorflow environment, which now results in a non-conflicting numpy version. Issue resolved here.

numpy                     1.19.5           py38h9894fe3_2    conda-forge
tensorflow                2.6.2           cuda112py38ha230376_1    conda-forge

@ngam
Copy link
Contributor

ngam commented Feb 5, 2022

Now the pinning seems to be >=1.20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants