-
Notifications
You must be signed in to change notification settings - Fork 1.3k
from tensorflow.contrib.distributions.python.ops import bernoulli ImportError: cannot import name 'bernoulli' #285
Comments
Update by:
This will resolve your problem |
@robi56 thanks. Just in case others are having a problem here are the steps to correct the problem when running unit tests:
Thanks |
In case the solutions above do not work for you, in my env, the following did work:
My output for is: |
Hi there, I've made the aforementioned changes, however, it did not work for me. I am using is
is
The error is `
|
For people still having confusions: The actual code block (unchanged) is: from tensorflow.contrib.distributions.python.ops import bernoulli
from tensorflow.contrib.distributions.python.ops import categorical First solution If you are using the suggestions by @robi56 : from tensorflow.contrib.distributions import Bernoulli
from tensorflow.contrib.distributions import Categorical (notice that bernoulli and categorical are capitalized now) Make sure that you make the following changes in sampler = Bernoulli(probs=self._sampling_probability)
sample_id_sampler = Categorical(logits=outputs) Second solution or just make the following changes suggested by @ptresende : from tensorflow.python.ops.distributions import bernoulli
from tensorflow.python.ops.distributions import categorical Both the solutions work for me. |
new error after fixing the helper.py python -m unittest seq2seq.test.pipeline_test
|
i have this same issue and i am not sure how to fix it. |
Same error exists. |
@kritinemkul for your problem, change the following code in
|
@tigerneil Thank you for the solution. |
I got a problem after i solved the bernoulli ImportError and the AttributeError mentioned above.
I've check the path"C:\Users\user\AppData\Local\Temp" and there is no such file... |
Hi any luck resolving the above error ? I am facing the same error on tensorflow 1.8. |
Only solution 2 worked not solution 1. |
Hi, I followed the responses and I have changed the below files:
Also, I have changed the Tensorflow version to 1.15.2 But when I try to run: I face the following error after a lot of warning about deprecated files:
|
I face the same problem and has anyone solved this error? |
This particular problem can be solved by replacing the following line in
with the following line:
But of course there's a new error now:
Also, my fix somehow doesn't make the test pass. The test runs, but the training stops as max steps are reached. I'm not sure if that's okay or suggests a deeper bug. The final output has this:
|
No description provided.
The text was updated successfully, but these errors were encountered: