Python 在张量流中使用GMM时的Cholesky分解误差

Python 在张量流中使用GMM时的Cholesky分解误差,python,tensorflow,gmm,Python,Tensorflow,Gmm,在Tensorflow中使用GMM时,我遇到了这个奇怪的问题 InvalidArgumentError (see above for traceback): Cholesky decomposition was not successful. The input might not be valid. 我正在使用的代码如下所示 from tensorflow.contrib.factorization.python.ops import gmm as gmm_lib import random

在Tensorflow中使用GMM时,我遇到了这个奇怪的问题

InvalidArgumentError (see above for traceback): Cholesky decomposition was not successful. The input might not be valid.
我正在使用的代码如下所示

from tensorflow.contrib.factorization.python.ops import gmm as gmm_lib
import random
import numpy as np
import tensorflow as tf

class DataGen:
    start = 0
    batch_size = 100
    end = start + batch_size

    def __init__(self, points):
        self.points = points

    def next_batch(self):
        start = self.start
        end = self.end
        if end <= self.points.shape[0]:
            self.start += self.batch_size
            self.end += self.batch_size
            return tf.constant(self.points[start: end]), None


mu, sigma = 0, 0.1
x_1d = 10*np.random.randn(500, 1).astype('f') + 50
data_gen = DataGen(x_1d)

gmm = gmm_lib.GMM(1,random_seed=0)
gmm.fit(input_fn=data_gen.next_batch)
从tensorflow.contrib.factoriation.python.ops导入gmm作为gmm_lib
随机输入
将numpy作为np导入
导入tensorflow作为tf
类别DataGen:
开始=0
批量大小=100
结束=开始+批量大小
定义初始值(自身,点):
self.points=点
def下一批(自身):
开始=自我启动
结束=自我结束

如果end即使我也面临同样的麻烦,但当我们使用google colaboratory时,情况并非如此!! 您可以在云计算环境中执行所有实验。alreay设置:[colaboratorial][1]


即使我也面临同样的问题,但当我们使用google colaboratory时,情况并非如此!! 您可以在云计算环境中执行所有实验。alreay设置:[colaboratorial][1]