2

我先安装了torch深度学习模块git clone然后使用luarocks make,安装很成功。在require 'dp'火炬提示中效果很好。

但是当我尝试执行neuralnetwork_tutorial.lua ( th neuralnetwork_tutorial.lua) 时,它会抛出以下错误。

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

print在这些脚本中添加了一些语句来理解流程。我碰巧注意到在File.lua中获取对象后的第一步是确定对象的类型;其中8个已​​被宣布。类型已通过 0 到 7 声明,0 为TYPE_NIL. 但是代码失败了,因为它检测到类型 28(??)。

请问我哪里出错了?或者去哪里寻找问题?

PS:脚本自行下载数据,但由于某些标准企业代理设置问题,无法下载。因此,我亲自下载了数据MNIST,并将其存储在特定的数据目录中。如果这可能是一个线索?

4

1 回答 1

1

好的,这是代码中的一个错误(序列化的 MNIST 不是跨平台的)。通过使用 ascii 格式而不是二进制序列化数据集来修复。

于 2015-02-04T16:01:04.377 回答