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

pip does not support tensorflow installation requirements #8

Open
adamhall opened this issue Feb 5, 2020 · 3 comments
Open

pip does not support tensorflow installation requirements #8

adamhall opened this issue Feb 5, 2020 · 3 comments

Comments

@adamhall
Copy link

adamhall commented Feb 5, 2020

Hi Felix,

it would appear that pip no longer supports the version of tensorflow (<=12.0,>=1.6) that you are requiring. I did set pip to 18.1 and numpy to 1.14.5.

I get the message

Could not find a version that satisfies the requirement tensorflow<=1.12.0,>=1.6.0 (from safe-learning==0.0.1) (from versions: 1.13.0rc1, 1.13.0rc2, 1.13.1, 1.13.2, 1.14.0rc0, 1.14.0rc1, 1.14.0, 1.15.0rc0, 1.15.0rc1, 1.15.0rc2, 1.15.0rc3, 1.15.0, 1.15.2, 2.0.0a0, 2.0.0b0, 2.0.0b1, 2.0.0rc0, 2.0.0rc1, 2.0.0rc2, 2.0.0, 2.0.1, 2.1.0rc0, 2.1.0rc1, 2.1.0rc2, 2.1.0)
No matching distribution found for tensorflow<=1.12.0,>=1.6.0 (from safe-learning==0.0.1)

I instead tried setting the requirement to tensorflow==1.13.0 just to see what happens. It installed fine.

I went to try and run 1d_example.ipynb and got an error from gpflow

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-4ef92e5e9104> in <module>
      3 from functools import partial
      4 
----> 5 import gpflow
      6 import tensorflow as tf
      7 import pkg_resources

/usr/local/lib/python3.7/site-packages/gpflow/__init__.py in <module>
     16 # flake8: noqa
     17 from __future__ import absolute_import
---> 18 from . import (likelihoods, kernels, ekernels, param,
     19                model, gpmc, sgpmc, priors, gpr, svgp,
     20                vgp, sgpr, gplvm, tf_wraps, tf_hacks)

/usr/local/lib/python3.7/site-packages/gpflow/model.py in <module>
     17 from .param import Parameterized, AutoFlow, DataHolder
     18 from .mean_functions import Zero
---> 19 from scipy.optimize import minimize, OptimizeResult
     20 import numpy as np
     21 import tensorflow as tf

/usr/local/lib/python3.7/site-packages/scipy/optimize/__init__.py in <module>
    388 from __future__ import division, print_function, absolute_import
    389 
--> 390 from .optimize import *
    391 from ._minimize import *
    392 from ._root import *

/usr/local/lib/python3.7/site-packages/scipy/optimize/optimize.py in <module>
     35                    asarray, sqrt, Inf, asfarray, isinf)
     36 import numpy as np
---> 37 from .linesearch import (line_search_wolfe1, line_search_wolfe2,
     38                          line_search_wolfe2 as line_search,
     39                          LineSearchWarning)

/usr/local/lib/python3.7/site-packages/scipy/optimize/linesearch.py in <module>
     16 from warnings import warn
     17 
---> 18 from scipy.optimize import minpack2
     19 import numpy as np
     20 from scipy._lib.six import xrange

ImportError: numpy.core.multiarray failed to import

I double checked that numpy 1.14.5 was being used and even forced it by adding the code

import pkg_resources
pkg_resources.require("numpy==`1.14.5")

Any thoughts?

@befelix
Copy link
Owner

befelix commented Feb 10, 2020

Hi, which python version are you using? The library is tested against python 2.7 and 3.5 (I've just added this to the readme). Could you make sure that you're using either of those and try again?

@adamhall
Copy link
Author

Hi Felix,

I was using 3.7.6. As per your advice, I created a 3.5.3 environment and everything installed well, except I did get an error
"markdown 3.2.1 has requirement setuptools>=36, but you'll have setuptools 28.8.0 which is incompatible." which I don't think is related to your work.

Now when I run the jupyter notebooks I do get an error

ImportError: No module named 'numpy.core._multiarray_umath'

the first run each of them. But whenever I run it for a second time, your code runs smoothly. And it runs smoothly each time I run it after that. So it seems to be working now with python 3.5.3, despite some odd initialization error.

I'm looking forward to playing around with your library.

Case closed? What would it take to upgrade it to 3.7+ do you think? I might think about taking a stab at it.

@tessavdheiden
Copy link

Hi Felix,

So, it would be great to work with newer versions of all packages and Python (just to make it compatible with more user's environments).

I've changed the "tf." inside functions.py (inside "safe_learning") with "tf.compat.v1". Other than that, I still stumbled upon some errors in the notebook (1d example).

Could you help me resolve it?

I'm getting an error in the 3rd cell:
init() got multiple values for argument 'variance'

In this line:

kernel = (gpflow.kernels.Matern32(2, lengthscales=1, active_dims=[0, 1]) *
----> 2           gpflow.kernels.Linear(2, variance=[0.2, 1], ARD=True))

How can the kernel be called with 2d variance?

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

3 participants