tensorflow: ValueError while implementing GMM using skflow
Hi I am trying to implement GMM using tensorflow. But I am getting the following error :- ValueError: Features are incompatible with given information. Given features: Tensor(“input:0”, shape=(?, 198), dtype=float32), required signatures: TensorSignature(dtype=tf.float64, shape=TensorShape([Dimension(None), Dimension(198)]), is_sparse=False)
Operating System: Ubuntu 16.04 tensorflow version 1.0.0
from tensorflow.contrib.factorization.python.ops import gmm as gmm_lib gmm = gmm_lib.GMM(num_clusters, batch_size=1) gmm.fit(x.astype('float32'),steps=300) yy = gmm.predict(x,y=None)
x is a numpy array of shape (2384, 198)
Please find the stack trace in stackoverflow question
If I pass a float64
data then I get the following error:-
ValueError: Tensor conversion requested dtype float64 for Tensor with dtype float32: 'Tensor("sub_1:0", shape=(), dtype=float32)'
Please find the stack trace in stackoverflow question
I even tried to implement the gmm_test from here
But I got a new error :-
Traceback (most recent call last):
File "/home/xxxxx/anaconda3/lib/python3.5/site-packages/IPython/core/interactiveshell.py", line 2881, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-61-c8c19df9240a>", line 1, in <module>
gmm.fit(input_fn=input_fn(), steps=0)
TypeError: fit() got an unexpected keyword argument 'input_fn'
If it is a bug please fix it, otherwise provide an alternative
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 22 (7 by maintainers)
The GMM part is encapsulated as part of an Estimator (see https://www.tensorflow.org/extend/estimators). Think of that as a wrapper where you define your model and then use the class method “.fit()” to do the training. That will run sess.run() for you.
2017-05-02 14:50 GMT-04:00 vinay-hebb notifications@github.com:
– Xavi.