Skip to content

Error importing edward 1.3.5 with tensorflow 1.7.0 #882

Description

@bjfar

I have tensorflow 1.7.0 built from source and installed, and it seems to work ok by itself, but I cannot import edward:

>>> import tensorflow
/home/farmer/anaconda3/envs/general/lib/python3.6/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters
>>> print(tensorflow.__version__)
1.7.0
>>> import edward
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/farmer/anaconda3/envs/general/lib/python3.6/site-packages/edward/__init__.py", line 5, in <module>
    from edward import criticisms
  File "/home/farmer/anaconda3/envs/general/lib/python3.6/site-packages/edward/criticisms/__init__.py", line 7, in <module>
    from edward.criticisms.evaluate import *
  File "/home/farmer/anaconda3/envs/general/lib/python3.6/site-packages/edward/criticisms/evaluate.py", line 10, in <module>
    from edward.util import check_data, get_session, compute_multinomial_mode, \
  File "/home/farmer/anaconda3/envs/general/lib/python3.6/site-packages/edward/util/__init__.py", line 10, in <module>
    from edward.util.random_variables import *
  File "/home/farmer/anaconda3/envs/general/lib/python3.6/site-packages/edward/util/random_variables.py", line 15, in <module>
    from tensorflow.python.framework.ops import set_shapes_for_outputs
ImportError: cannot import name 'set_shapes_for_outputs'

I am on Ubuntu 16.04 LTS and using the edward version installed via pip, which appears to be 1.3.5:

$ pip show edward
Name: edward
Version: 1.3.5
Summary: A library for probabilistic modeling, inference, and criticism
Home-page: http://edwardlib.org
Author: Dustin Tran
Author-email: dustin@cs.columbia.edu
License: Apache License 2.0
Location: /home/farmer/anaconda3/envs/general/lib/python3.6/site-packages
Requires: six, numpy

I was going to try building edward from source, but the latest tagged version seems to be 1.3.5 anyway so I guess this will not help. My Python version is 3.6.4.

edit: Ah, although if I install tensorflow via pip (which also seems to be version 1.7.0) then edward does work. This seems odd to me... I guess something could be wrong with my tensorflow build, but it seems to work. I wanted to build it from source since the pip version doesn't use various vectorisation options that my CPU can do.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions