Tensorflow GMM.fit分段错误

Tensorflow GMM.fit分段错误,tensorflow,machine-learning,gmm,Tensorflow,Machine Learning,Gmm,我现在尝试在我的实验中使用GMM。但我有以下问题。我对这个错误感到很困惑 将tensorflow导入为tf GMMDataLoader类: 定义初始值(自身、点、批次大小): self.points=点 self.batch\u size=批次大小 点数=点数。形状[0] self.num\u points=num\u points 尺寸=点。形状[1] self.count=0 #self.x=tf.常数(self.points) 打印('总共加载了%d个点,维度为%d'(点数,dim)) d

我现在尝试在我的实验中使用GMM。但我有以下问题。我对这个错误感到很困惑

将tensorflow导入为tf
GMMDataLoader类:
定义初始值(自身、点、批次大小):
self.points=点
self.batch\u size=批次大小
点数=点数。形状[0]
self.num\u points=num\u points
尺寸=点。形状[1]
self.count=0
#self.x=tf.常数(self.points)
打印('总共加载了%d个点,维度为%d'(点数,dim))
def下一批(自身,批大小=128):
self.count+=1
计数=self.count+1
打印('batch[%d]'%count)
num_points=self.num_points
x=tf常数(自身点)
指数=tf.随机均匀(tf.常数([批次大小]),
最小值=0,最大值=num_点-1,
dtype=tf.int32,
种子=10)
返回tf.gather(x,索引),无
将numpy作为np导入
x=np.random.random((100002048)).astype('float32'))
加载器=GMMDataLoader(x,128)
gmm_model=tf.contrib.factorization.gmm(初始_clusters='random',num_clusters=100,random_seed=666)
gmm_model.fit(输入_fn=loader.next_批次)
运行此代码时,出现以下错误:

Loaded in a total of 10000 points, the dimension is 2048
WARNING:tensorflow:Using temporary folder as model directory: /tmp/tmp19vzg37k
WARNING:tensorflow:From /u/usr/usr/anaconda2/envs/py35/lib/python3.5/site-packages/tensorflow/contrib/factorization/python/ops/gmm_ops.py:59: calling reduce_mean (from tensorflow.python.ops.math_ops) with keep_dims is deprecated and will be removed in a future version.
Instructions for updating:
keep_dims is deprecated, use keepdims instead
WARNING:tensorflow:From /u/usr/usr/anaconda2/envs/py35/lib/python3.5/site-packages/tensorflow/contrib/factorization/python/ops/gmm_ops.py:353: calling reduce_logsumexp (from tensorflow.python.ops.math_ops) with keep_dims is deprecated and will be removed in a future version.
Instructions for updating:
keep_dims is deprecated, use keepdims instead
WARNING:tensorflow:From /u/usr/usr/anaconda2/envs/py35/lib/python3.5/site-packages/tensorflow/contrib/factorization/python/ops/gmm_ops.py:377: calling reduce_sum (from tensorflow.python.ops.math_ops) with keep_dims is deprecated and will be removed in a future version.
Instructions for updating:
keep_dims is deprecated, use keepdims instead
WARNING:tensorflow:From /u/usr/usr/anaconda2/envs/py35/lib/python3.5/site-packages/tensorflow/contrib/factorization/python/ops/gmm.py:170: get_global_step (from tensorflow.contrib.framework.python.ops.variables) is deprecated and will be removed in a future version.
Instructions for updating:
Please switch to tf.train.get_global_step
2018-01-21 13:25:54.515678: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA
2018-01-21 13:25:55.440734: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1062] Found device 0 with properties:
name: Tesla P100-SXM2-16GB major: 6 minor: 0 memoryClockRate(GHz): 1.4805
pciBusID: 0000:89:00.0
totalMemory: 15.89GiB freeMemory: 15.60GiB
2018-01-21 13:25:56.339431: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1062] Found device 1 with properties:
name: Tesla P100-SXM2-16GB major: 6 minor: 0 memoryClockRate(GHz): 1.4805
pciBusID: 0000:8a:00.0
totalMemory: 15.89GiB freeMemory: 15.60GiB
2018-01-21 13:25:56.339489: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1077] Device peer to peer matrix
2018-01-21 13:25:56.339527: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1083] DMA: 0 1
2018-01-21 13:25:56.339536: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1093] 0:   Y Y
2018-01-21 13:25:56.339543: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1093] 1:   Y Y
2018-01-21 13:25:56.339564: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1152] Creating TensorFlow device (/device:GPU:0) -> (device: 0, name: Tesla P100-SXM2-16GB, pci bus id: 0000:89:00.0, compute capability: 6.0)
2018-01-21 13:25:56.339574: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1152] Creating TensorFlow device (/device:GPU:1) -> (device: 1, name: Tesla P100-SXM2-16GB, pci bus id: 0000:8a:00.0, compute capability: 6.0)
2018-01-21 13:28:44.093288: I tensorflow/core/kernels/cuda_solvers.cc:159] Creating CudaSolver handles for stream 0x564187890370
Segmentation fault

有人知道怎么修吗

这是由于数据样本和高斯分布之间的距离计算中内存分配过多造成的

修复程序已提交,不久将可用。如果您想禁用Tensorflow图的该部分,请在此处注释: