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

Fix for: Trouble getting up and running in Jupyter notebook with Python 3.8.9 #3 #4

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

JamesTimothyMeech
Copy link

I applied the fix by replacing all instances of:

import tensorflow as tf with:

import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()

and replacing instances of tf.contrib. with tf.

as per: https://stackoverflow.com/questions/59644859/attributeerror-module-tensorflow-core-compat-v1-has-no-attribute-contrib

Unfortunately I haven't managed to remove the metadata from the notebooks to make the PR look neat yet.

@JamesTimothyMeech
Copy link
Author

Code still fails at last cell with error:


ValueError Traceback (most recent call last)
in
13 saver = tf.train.Saver()
14 saver.restore(sess, ckpt_path)
---> 15 fake_data = test_model.predict(sess, seq_len)
16 fig, axes = plt.subplots(1,2, figsize=((14,8)))
17 axes[0].plot(true_data)

~/Desktop/sensegen/model.py in predict(self, sess, seq_len)
216 )
217 # chose one
--> 218 select_mixture = np.random.choice(self.num_mixtures, p=pi_[0])
219 #new_pred_ = np.random.normal(loc=mu_[0
220 new_pred_ = np.random.normal(loc=mu_[0][select_mixture], scale=sigma_[0][select_mixture])

mtrand.pyx in numpy.random.mtrand.RandomState.choice()

ValueError: probabilities contain NaN

@JamesTimothyMeech
Copy link
Author

Now working as expected

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

Successfully merging this pull request may close these issues.

1 participant