mirror of
https://github.com/marian-nmt/marian.git
synced 2024-09-17 09:47:34 +03:00
load images. segfaults on labels
This commit is contained in:
parent
6a8d5c1997
commit
14e536c779
10
src/test.cu
10
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<float> images = datasets::mnist::ReadImages("../examples/mnist/t10k-images-idx3-ubyte", numImg, imgSize);
|
||||
vector<float> 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;
|
||||
|
Loading…
Reference in New Issue
Block a user