From 14e536c7794121ad220bb17a8e99d4fc3e501496 Mon Sep 17 00:00:00 2001 From: Hieu Hoang Date: Wed, 14 Sep 2016 07:53:43 +0100 Subject: [PATCH] load images. segfaults on labels --- src/test.cu | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/test.cu b/src/test.cu index c1f53c02..4ef9953f 100644 --- a/src/test.cu +++ b/src/test.cu @@ -24,16 +24,16 @@ int main(int argc, char** argv) { auto graph = -mean(sum(y * log(lr), axis=1), axis=0, name="cost"); cerr << "lr=" << lr.Debug() << endl; - - Tensor tx({500, 784}, 1); - Tensor ty({500, 10}, 1); - int numImg, imgSize; vector images = datasets::mnist::ReadImages("../examples/mnist/t10k-images-idx3-ubyte", numImg, imgSize); vector labels = datasets::mnist::ReadLabels("../examples/mnist/t10k-labels-idx1-ubyte"); cerr << "images=" << images.size() << " labels=" << labels.size() << endl; + + Tensor tx({numImg, 784}, 1); + Tensor ty({numImg, 10}, 1); + tx.Load(images); - //ty.Load(labels); + ty.Load(labels); cerr << "tx=" << tx.Debug() << endl; cerr << "ty=" << ty.Debug() << endl;