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 in ... notebooks/2_BasicModels/kmeans.ipynb #220

Open
Scoodood opened this issue Jan 5, 2018 · 4 comments
Open

Error in ... notebooks/2_BasicModels/kmeans.ipynb #220

Scoodood opened this issue Jan 5, 2018 · 4 comments

Comments

@Scoodood
Copy link

Scoodood commented Jan 5, 2018

This line gives

# Build KMeans graph
(all_scores, cluster_idx, scores, cluster_centers_initialized, init_op, train_op) = kmeans.training_graph()
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-9-8f6c815e4bb3> in <module>()
      1 # Build KMeans graph
      2 (all_scores, cluster_idx, scores, cluster_centers_initialized, init_op,
----> 3 train_op) = kmeans.training_graph()
      4 cluster_idx = cluster_idx[0] # fix for cluster_idx being a tuple
      5 avg_distance = tf.reduce_mean(scores)

ValueError: not enough values to unpack (expected 6, got 4)

The rest of the cells gives errors as well...

@ai4pharma
Copy link

ai4pharma commented Jan 16, 2018

It works for me after following modification. It's based on https://www.tensorflow.org/api_docs/python/tf/contrib/factorization/KMeans. It seems Tensorflow 1.4.1 returns a tuple with 7 elements.

(all_scores, cluster_idx, scores, cluster_centers_initialized, cluster_centers_var, init_op,
train_op) = kmeans.training_graph()

@filipre
Copy link

filipre commented Feb 27, 2018

for me training_graph() returns 6 elements:

(all_scores, cluster_idx, scores, cluster_centers_initialized, init_op, train_op) = kmeans.training_graph()

It is fixed in the python files, but not the notebooks: https://github.com/aymericdamien/TensorFlow-Examples/blob/master/examples/2_BasicModels/kmeans.py

It sounds like a good time to introduce an environment.yml file to prevent issues like these.

@Moulick
Copy link
Contributor

Moulick commented Mar 23, 2018

@filipre which Tensorflow version do you have ?

@pleabargain
Copy link

submitted fix here
#236

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

5 participants