seq2seq icon indicating copy to clipboard operation
seq2seq copied to clipboard

ImportError: cannot import name 'bernoulli'

Open nrawal-welocalize opened this issue 8 years ago • 8 comments

tensorflow_error_test

nrawal-welocalize avatar Jun 19 '17 15:06 nrawal-welocalize

My guess is you are using tensorflow 1.2

You need to change some API calls according to https://github.com/google/seq2seq/pull/254

0b01 avatar Jun 19 '17 16:06 0b01

@rickyhan I am having the same error as @nrawal-welocalize . And you are right my version of tensorflow is 1.2 , Is there a way that I could install an older version of tensorflow

soukira avatar Jun 24 '17 17:06 soukira

I have made all the changes as suggested in #254 , and the same error is displayed , is there something I am missing???

soukira avatar Jun 24 '17 20:06 soukira

After all the changes , these new errors pop up File "C:\Python\Python35\Lib\site-packages\seq2seq\seq2seq\contrib\experiment.py", line 104, in continuous_train_and_eval monitors=self._train_monitors) File "C:\Python\Python35\lib\site-packages\tensorflow\python\util\deprecation.py", line 289, in new_func return func(*args, **kwargs) File "C:\Python\Python35\lib\site-packages\tensorflow\contrib\learn\python\learn\estimators\estimator.py", line 455, in fit loss = self._train_model(input_fn=input_fn, hooks=hooks) File "C:\Python\Python35\lib\site-packages\tensorflow\contrib\learn\python\learn\estimators\estimator.py", line 1003, in _train_model config=self._session_config File "C:\Python\Python35\lib\site-packages\tensorflow\python\training\monitored_session.py", line 352, in MonitoredTrainingSession stop_grace_period_secs=stop_grace_period_secs) File "C:\Python\Python35\lib\site-packages\tensorflow\python\training\monitored_session.py", line 648, in init stop_grace_period_secs=stop_grace_period_secs) File "C:\Python\Python35\lib\site-packages\tensorflow\python\training\monitored_session.py", line 470, in init h.begin() File "C:\Python\Python35\Lib\site-packages\seq2seq\seq2seq\training\hooks.py", line 246, in begin opts = tf.contrib.tfprof.model_analyzer.TRAINABLE_VARS_PARAMS_STAT_OPTIONS AttributeError: module 'tensorflow.contrib.tfprof' has no attribute 'model_analyzer'


Ran 2 tests in 9.513s

FAILED (errors=1)

soukira avatar Jun 25 '17 17:06 soukira

@soukira - Not sure why that doesn't work for you, it works fine here.

What about trying these:

python -c "import tensorflow as tf; print(tf.VERSION, tf.GIT_VERSION, tf.__file__)"
python -c "import tensorflow as tf; print(tf.contrib.tfprof.model_analyzer.TRAINABLE_VARS_PARAMS_STAT_OPTIONS)"

I get 1.2.0 b'v1.2.0-1369-g7786731 /path/to/site-packages/tensorflow/__init__.py' (although I'm on a version built myself) and a bunch of JSON from the second command.

Did you perhaps do a local install of TF 1.2 and not overwrite the one under \Python\Python35\lib\...?

darrengarvey avatar Jun 27 '17 18:06 darrengarvey

Thanks for your reply. This problem has been solved i should close it now, My problem is now with the tf.contrib and i have raised an issue under github and heard its not supported on windows module yet.

On Tue, Jun 27, 2017 at 11:37 PM, Darren Garvey [email protected] wrote:

@soukira https://github.com/soukira - Not sure why that doesn't work for you, it works fine here.

What about trying these:

python -c "import tensorflow as tf; print(tf.VERSION, tf.GIT_VERSION, tf.file)" python -c "import tensorflow as tf; print(tf.contrib.tfprof.model_analyzer.TRAINABLE_VARS_PARAMS_STAT_OPTIONS)"

I get 1.2.0 b'v1.2.0-1369-g7786731 /path/to/site-packages/ tensorflow/init.py' (although I'm on a version built myself) and a bunch of JSON from the second command.

Did you perhaps do a local install of TF 1.2 and not overwrite the one under \Python\Python35\lib...?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/google/seq2seq/issues/259#issuecomment-311439161, or mute the thread https://github.com/notifications/unsubscribe-auth/AYtdaTwETdT8uq94KI6JRuRPC95Zf9k0ks5sIUTigaJpZM4N-blh .

soukira avatar Jun 28 '17 09:06 soukira

So does it mean that this library is not supported on Windows?

linzhp avatar Jul 21 '17 23:07 linzhp

really?o, should i run this on my linux visual machine? i didn't solve this problem,and get the same json code below,there is no other way of solveing this problem?

miko8422 avatar Jan 18 '22 08:01 miko8422