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

Error importing edward 1.3.5 with tensorflow 1.7.0 #882

Open
bjfar opened this issue Apr 16, 2018 · 33 comments
Open

Error importing edward 1.3.5 with tensorflow 1.7.0 #882

bjfar opened this issue Apr 16, 2018 · 33 comments

Comments

@bjfar
Copy link

bjfar commented Apr 16, 2018

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.

@dustinvtran
Copy link
Member

Looks like the function no longer exists in TF 1.7.0. Following the commit, we may be able to just remove it in the ed.copy implementation (tensorflow/tensorflow@9fc9f19#diff-66fbf57743aed7c8407bcb218db3c491L2477).

@andersdot
Copy link

I'm having the same issue, any updates on this?

@sadatnfs
Copy link

sadatnfs commented May 3, 2018

TF 1.8.0 has been released, I wonder how much other changes have been in TF that Edward would need.. :/

@sunny1205124
Copy link

I tried to use the lower versions of TF and edward, then I can import both TF and edward successfully now. But for TF1.7.0 and 1.8.0, the same problem with you.

@hiraksarkar
Copy link

Any fix yet?

@diego-vicente
Copy link

Having the same problem with tensorflow 1.8.0 built from source

@IanQS
Copy link

IanQS commented May 9, 2018

If you follow this PR you'll see followups. I'm not sure if there's a discussion on another platform (if there is please let me know I'd love to see and contribute to solving this issue)

@larsr
Copy link

larsr commented May 14, 2018

I noticed that set_shapes_for_outputs now (since 9fc9f19428e497f3a) seems to be called set_shape_and_handle_data_for_outputs

See a kludge solution here

@IanQS
Copy link

IanQS commented May 14, 2018

@larsr Can you try running the tests? Because I'm pretty sure I tried that and it failed the copy tests

@larsr
Copy link

larsr commented May 14, 2018

@IanQS yeah, I did cd edward/tests; pytest . and got "86 failed, 240 passed, 44 warnings". In particular pytest util/copy_test.py got 20 failed and 3 passed. Alas, there are more things to take care of.

@devinbostIL
Copy link

I installed TensorFlow via pip and still got this problem.

@devinbostIL
Copy link

I created a pull request here: #894

@IanQS
Copy link

IanQS commented May 18, 2018

@devinbostIL Because it still fails the tests

@sadatnfs
Copy link

yeah I don't think Master still has it pulled in eh

@chnynf
Copy link

chnynf commented May 18, 2018

Having the same issue. Is there a work around for now?

@prithagupta
Copy link

Having the same issue. Is there a work around for now?

@IanQS
Copy link

IanQS commented May 25, 2018

workaround is to use an older version of Tensorflow (Edward should work with it up to tf 1.6)

@frank-y-liu
Copy link

Any estimated time to get this fixed? More importantly when the fix will be released to the pip channel? I know google is releasing TF at a rapid pace. Unfortunately I can't revert back to an older version of TF simply because of Edward.

@BiagioAntonelli
Copy link

I'm having the same issue, any fix?

@weininghu1012
Copy link

Same issue here, any possible alternative?

@acanacar
Copy link

having the same issue.Is there any solution?

@halilbilgin
Copy link

halilbilgin commented Jul 6, 2018

Same issue :) The only thing that works is reverting to the tensorflow==1.5.0, which is not a solution at all since I need tensorflow 1.7.0

@jsevo
Copy link

jsevo commented Jul 12, 2018

same issue. confirm it works fine with tensorflow==1.5.0.

unfortunately unusable atm if you need tf 1.7

@hani1814
Copy link

hani1814 commented Sep 7, 2018

Hi, any idea when the compatibility issue with version TF>=1.7 is going to be resolved?

Many thanks

@sadatnfs
Copy link

sadatnfs commented Sep 7, 2018

Almost certain that development on upgrading to new TF is not gonna happen any longer since Edward is now a part of TFP

@braadbaart
Copy link

braadbaart commented Dec 1, 2018

Indeed, most of the functionality has been ported to https://www.tensorflow.org/probability/. See https://github.com/tensorflow/probability/blob/master/tensorflow_probability/python/edward2/Upgrading_From_Edward_To_Edward2.md

@pranav-vempati
Copy link

Having the same issue with TensorFlow 1.9.0

@LZaltius
Copy link

same issue with tf 1.11.0

@dpmerrell
Copy link

And 1.12.0 today.

It seems like newcomers should learn TensorFlow Probability/Edward2 rather than Edward 1, even though there's no mention of it on the Edward website.

@janosh
Copy link

janosh commented Feb 14, 2019

It seems like newcomers should learn TensorFlow Probability/Edward2 rather than Edward 1, even though there's no mention of it on the Edward website.

This should definitely be advised on the Edward website.

@fjssharpsword
Copy link

My solution is :
1)find file: edward/util/random_variables.py
2)replace the import line:
from tensorflow.python.framework.ops import set_shape_and_handle_data_for_outputs as set_shapes_for_outputs
It works.

@felipefmoreira
Copy link

@fjssharpsword indeed, it worked.

@jihwan-jeong
Copy link

@fjssharpsword Thanks! It worked :D

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