Closed FrankWessels closed 8 years ago
The source
for data layer should be a txt file containing a list of filenames to the actual HDF5 files. Please do not use the filename for the HDF5 file directly.
Thx, fixed it, it works now, sorry for bothering
I have no idea why, also happens on a fresh installation. I will try some other tutorials first.
Julia version 0.4.2 on ubuntu 15.10
code (last line gives error):
using Mocha srand(12345678)
data_layer = AsyncHDF5DataLayer(name="train-data", source="data/train.hdf5", batch_size=64, shuffle=true) conv_layer = ConvolutionLayer(name="conv1", n_filter=20, kernel=(5,5), bottoms=[:data], tops=[:conv]) pool_layer = PoolingLayer(name="pool1", kernel=(2,2), stride=(2,2), bottoms=[:conv], tops=[:pool]) conv2_layer = ConvolutionLayer(name="conv2", n_filter=50, kernel=(5,5), bottoms=[:pool], tops=[:conv2]) pool2_layer = PoolingLayer(name="pool2", kernel=(2,2), stride=(2,2), bottoms=[:conv2], tops=[:pool2]) fc1_layer = InnerProductLayer(name="ip1", output_dim=500, neuron=Neurons.ReLU(), bottoms=[:pool2], tops=[:ip1]) fc2_layer = InnerProductLayer(name="ip2", output_dim=10, bottoms=[:ip1], tops=[:ip2]) loss_layer = SoftmaxLossLayer(name="loss", bottoms=[:ip2,:label])
backend = DefaultBackend() init(backend)
common_layers = [conv_layer, pool_layer, conv2_layer, pool2_layer, fc1_layer, fc2_layer] net = Net("MNIST-train", backend, [data_layer, common_layers..., loss_layer])
error:
22-feb 13:55:54:INFO:root:Constructing net MNISTtrain on Mocha.CPUBackend... 22-feb 13:55:54:INFO:root:Topological sorting 8 layers... 22-feb 13:55:54:INFO:root:Setup layers... ERROR: UnicodeError: invalid character index in next at ./unicode/utf8.jl:65 in isspace at unicode/utf8proc.jl:175 in anonymous at /home/frank/.julia/v0.4/Mocha/src/layers/hdf5-data.jl:34 in filter at array.jl:940 in anonymous at /home/frank/.julia/v0.4/Mocha/src/layers/hdf5-data.jl:34 in open at iostream.jl:114 in call at /home/frank/.julia/v0.4/Mocha/src/layers/hdf5-data.jl:33 in setup at /home/frank/.julia/v0.4/Mocha/src/layers/hdf5-data.jl:81 in setup at /home/frank/.julia/v0.4/Mocha/src/layers.jl:112 in call at /home/frank/.julia/v0.4/Mocha/src/net.jl:227