Tanny
Tanny

Reputation: 540

Issue with neuralnetwork_turial.lua with data preprocessing

I have installed the torch deep learning module by first git clone-ing and later using luarocks make and the installation was succussful. The require 'dp' works well in the torch prompt.

But when I try to execute the neuralnetwork_tutorial.lua(th neuralnetwork_tutorial.lua), it throws the following errors.

Tanny @neuralnetwork_tutorial.lua: About to initiate: datasource = dp.Mnist{input_preprocess = dp.Standardize()}
Tanny @/home/ubuntu/binaries/torches/torch/install/share/lua/5.1/dp/preprocess/standardize.lua: Marked presence!!!
Tanny @/home/ubuntu/binaries/torches/torch/install/share/lua/5.1/dp/torch/File.lua says: @177 typeidx=  3
Tanny @/home/ubuntu/binaries/torches/torch/install/share/lua/5.1/dp/torch/File.lua says: @177 typeidx=  1
Tanny @/home/ubuntu/binaries/torches/torch/install/share/lua/5.1/dp/torch/File.lua says: @177 typeidx=  4
Tanny @/home/ubuntu/binaries/torches/torch/install/share/lua/5.1/dp/torch/File.lua says: @177 typeidx=  0
Tanny @/home/ubuntu/binaries/torches/torch/install/share/lua/5.1/dp/torch/File.lua says: @177 typeidx=  28
Tanny @/home/ubuntu/binaries/torches/torch/install/share/lua/5.1/dp/torch/File.lua says: @259 typeidx=  28
/home/ubuntu/binaries/torches/torch/install/bin/luajit: ...aries/torches/torch/install/share/lua/5.1/torch/File.lua:260: unknown object
stack traceback:
        [C]: in function 'error'
        ...aries/torches/torch/install/share/lua/5.1/torch/File.lua:260: in function 'readObject'
        ...aries/torches/torch/install/share/lua/5.1/torch/File.lua:252: in function 'readObject'
        ...aries/torches/torch/install/share/lua/5.1/torch/File.lua:277: in function 'loadData'
        ...es/torches/torch/install/share/lua/5.1/dp/data/mnist.lua:74: in function 'loadTrainValid'
        ...es/torches/torch/install/share/lua/5.1/dp/data/mnist.lua:61: in function '__init'
        ...aries/torches/torch/install/share/lua/5.1/torch/init.lua:50: in function <...aries/torches/torch/install/share/lua/5.1/torch/init.lua:46>
        [C]: in function 'Mnist'
        neuralnetwork_tutorial.lua:16: in main chunk
        [C]: in function 'dofile'
        ...ches/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:131: in main chunk
        [C]: at 0x0804d650

I put some print statements in those scripts to understand the flow. I happen to notice that in File.lua the first step after getting the object is to determine the type of the object; of which 8 have been declared. The types have been declared through 0 to 7, 0 being TYPE_NIL. However the code fails, as it detects a type 28(??).

Kindly any help where I am going wrong? Or where to look into to find the issue?

P.S.: The script downloads the data on its own, however due to certain standard corporate proxy setting issues, it could not download. Therefore, I personally downloaded the data MNIST and stored it in the specific data directory. If this could be a clue??

Upvotes: 2

Views: 479

Answers (1)

Nicholas Leonard
Nicholas Leonard

Reputation: 2696

Okay, so it was a bug in the code (serialized MNIST wasn't cross-platform). Fixed by serializing dataset using ascii format instead of binary.

Upvotes: 1

Related Questions