edward
edward copied to clipboard
Import Error
import edward is giving Import Error. ImportError: cannot import name 'set_shapes_for_outputs'
from .conv import register_converters as register_converters
Traceback (most recent call last):
File "
File "C:\Users\gowth\Anaconda3\envs\py36\lib\site-packages\edward\util_init_.py", line 10, in
Same here
import edward Traceback (most recent call last): File "
", line 1, in File "/home/liuchen/anaconda3/lib/python3.6/site-packages/edward/init.py", line 5, in from edward import criticisms File "/home/liuchen/anaconda3/lib/python3.6/site-packages/edward/criticisms/init.py", line 7, in from edward.criticisms.evaluate import * File "/home/liuchen/anaconda3/lib/python3.6/site-packages/edward/criticisms/evaluate.py", line 10, in from edward.util import check_data, get_session, compute_multinomial_mode,
File "/home/liuchen/anaconda3/lib/python3.6/site-packages/edward/util/init.py", line 10, infrom edward.util.random_variables import * File "/home/liuchen/anaconda3/lib/python3.6/site-packages/edward/util/random_variables.py", line 15, in from tensorflow.python.framework.ops import set_shapes_for_outputs ImportError: cannot import name 'set_shapes_for_outputs'
I downgraded tf version to required specifications, it is working now. It's tf version 1.2.0
first import tensorflow as tf then from edward.models import Normal
Could edward devs please be more explicit about which version of tensorflow is required to run edward? It's frustrating and a time-sink to iterate through various TF versions trying to find the most recent version that is still compatible with Edward.
The TF API is changing rapidly, so it's hard to keep up, but even a simple requirements.txt would suffice.
it still does not work
first import tensorflow as tf then from edward.models import Normal
After tried many times with different combinations of tensorflow and edward version, I finally found the newest Edward and tensorflow 1.2.0 works!
use google colab install tf1.2.0 can solve this question