GithubHelp home page GithubHelp logo

tutorials's Introduction

Machine Learning with Torch7

All the documentation for these tutorials is available on this page.

tutorials's People

Contributors

ahaque avatar clementfarabet avatar gokceneraslan avatar golden1232004 avatar gregwayne avatar psukys avatar punchagan avatar ronanmoynihan avatar soumith avatar szagoruyko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tutorials's Issues

could not load library GraphocsMagickWand:tutorials/coursera_neural_nets/assignment1

error info::
/torch/install/share/lua/5.2/graphicsmagick/Image.lua:322: could not load library GraphicsMagickWand
stack traceback:
[C]: in function 'error'
/home/anjiang/torch/install/share/lua/5.2/trepl/init.lua:386: in function 'require'
main.lua:5: in main chunk
[C]: in function 'dofile'
...iang/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
[C]: in ?

am I missing some lib?

ubgpu@ubgpu:/github/torch/tutorials/3_unsupervised$ ll
total 44
drwxrwxr-x 3 ubgpu ubgpu 4096 8月 23 19:34 ./
drwxrwxr-x 12 ubgpu ubgpu 4096 8月 23 04:47 ../
-rw-rw-r-- 1 ubgpu ubgpu 5989 8月 23 04:47 1_data.lua
-rw-rw-r-- 1 ubgpu ubgpu 3613 8月 23 04:47 2_models.lua
-rw-rw-r-- 1 ubgpu ubgpu 5330 8月 23 04:47 3_train.lua
-rw-rw-r-- 1 ubgpu ubgpu 3111 8月 23 04:47 A_kmeans.lua
-rw-rw-r-- 1 ubgpu ubgpu 4232 8月 23 04:47 doall.lua
drwxrwxr-x 2 ubgpu ubgpu 4096 8月 23 04:47 img/
ubgpu@ubgpu:
/github/torch/tutorials/3_unsupervised$
ubgpu@ubgpu:/github/torch/tutorials/3_unsupervised$
ubgpu@ubgpu:
/github/torch/tutorials/3_unsupervised$ th doall.lua
/home/ubgpu/torch/install/bin/luajit: /home/ubgpu/torch/install/share/lua/5.1/trepl/init.lua:354: module 'unsup' not found:No LuaRocks module found for unsup
no field package.preload['unsup']
no file '/home/ubgpu/.luarocks/share/lua/5.1/unsup.lua'
no file '/home/ubgpu/.luarocks/share/lua/5.1/unsup/init.lua'
no file '/home/ubgpu/torch/install/share/lua/5.1/unsup.lua'
no file '/home/ubgpu/torch/install/share/lua/5.1/unsup/init.lua'
no file './unsup.lua'
no file '/home/ubgpu/torch/install/share/luajit-2.1.0-alpha/unsup.lua'
no file '/usr/local/share/lua/5.1/unsup.lua'
no file '/usr/local/share/lua/5.1/unsup/init.lua'
no file '/home/ubgpu/.luarocks/lib/lua/5.1/unsup.so'
no file '/home/ubgpu/torch/install/lib/lua/5.1/unsup.so'
no file './unsup.so'
no file '/usr/local/lib/lua/5.1/unsup.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
[C]: in function 'error'
/home/ubgpu/torch/install/share/lua/5.1/trepl/init.lua:354: in function 'require'
doall.lua:27: in main chunk
[C]: in function 'dofile'
...bgpu/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:131: in main chunk
[C]: at 0x00406640
ubgpu@ubgpu:~/github/torch/tutorials/3_unsupervised$

7_imagenet_classification for CPU only machine

Hi,

I cannot run the notebook of imagenet_classification with my CPU only machine. It requires cuda.
I kept getting errors like

MODULE data UNDEFINED warning: module 'data [type 5]' not found deploy.prototxt.lua:32: attempt to call method 'ceil' (a nil value) stack traceback: deploy.prototxt.lua:32: in main chunk [C]: in function 'dofile' /root/torch/install/share/lua/5.1/loadcaffe/loadcaffe.lua:24: in function 'load' [string "-- Setting up networks and downloading stuff ..."]:21: in main chunk [C]: in function 'xpcall' /root/torch/install/share/lua/5.1/itorch/main.lua:179: in function </root/torch/install/share/lua/5.1/itorch/main.lua:143> /root/torch/install/share/lua/5.1/lzmq/poller.lua:75: in function 'poll' /root/torch/install/share/lua/5.1/lzmq/impl/loop.lua:307: in function 'poll' /root/torch/install/share/lua/5.1/lzmq/impl/loop.lua:325: in function 'sleep_ex' /root/torch/install/share/lua/5.1/lzmq/impl/loop.lua:370: in function 'start' /root/torch/install/share/lua/5.1/itorch/main.lua:350: in main chunk [C]: in function 'require' [string "arg={'/root/.local/share/jupyter/runtime/kern..."]:1: in main chunk

installing torch issue on mac

I am getting the following error. can anyone help me with this.

Error: could not find ipython in PATH. Do you have it installed?
cd build && make install
sh: line 0: cd: build: No such file or directory

Error: Build error: Failed installing.

Not updating your shell profile.
You might want to
add the following lines to your shell profile:

2_supervised cuda ClassNLLCriterion.lua error

Got this while running 2_supervised with cuda option

/usr/local/bin/luajit: /usr/local/share/lua/5.1/nn/ClassNLLCriterion.lua:15: bad argument #3 to 'ClassNLLCriterion_updateOutput' (torch.CudaTensor expected, got number)

Wiki link dead

The link to the wiki in the readme is no longer working.

7_imagenet_classification fails because "ceil()" is undefined for "SpatialAveragePooling"

When I tried to run the demo of 7_imagenet_classification as th classify.lua, I received the following error:

==> Loading network     
Successfully loaded ./nin_imagenet.caffemodel
MODULE data UNDEFINED
warning: module 'data' not found
/home/ma/feng/torch/install/bin/luajit: deploy.prototxt.lua:34: attempt to cal
l method 'ceil' (a nil value)                                                
stack traceback:
        deploy.prototxt.lua:34: in main chunk
        [C]: in function 'dofile'
        ...feng/torch/install/share/lua/5.1/loadcaffe/loadcaffe.lua:20: in fun
ction 'load'                                                                 
        classify.lua:55: in main chunk
        [C]: in function 'dofile'
        ...feng/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:131: in ma
in chunk                                                                     
        [C]: at 0x00406240

I check the generated deploy.prototxt.lua, which is

table.insert(model, {'pool4', nn.SpatialAveragePooling(6, 6, 1, 1):ceil()})

cuda ClassNLLCriterion.lua error

I got the following error with cuda option(CUDNN v3 was used),
44: bad argument #3 to 'ClassNLLCriterion_updateOutput' (torch.CudaTensor expected, got number)
I am not able to get what was the error
Thanks in advance

Problem with Unsup and dofile

I have some difficult to resolve that issue. I install unsup but it's look like not working. I uninstall and install again and i show what i have .

/usr/local/bin/luajit: model.lua:37: attempt to index global 'unsup' (a nil value)
stack traceback:
model.lua:37: in main chunk
[C]: in function 'dofile'
tuto.lua:77: in main chunk
[C]: in function 'dofile'
/usr/local/lib/luarocks/rocks/trepl/scm-1/bin/th:109: in main chunk
[C]: at 0x00405e60

Confusion with optimizations.

I noticed in the optim methods there's a required feval to be passed through. For example:

Is f a loss function, then what is x? In some code (e.x. LSTM), why they weren't using optim?

Error tutorials while preprocessing data: normalize all three channels locally

Hi!, first of all saying that I'm new using torch and itorch, but I have been trying a couple of afternoons to make this tutorial work and I am still getting an error.
In tutorial 2 part 1, when loading the data I have no problems doing it from console...but when I try to do it from the itorch notebook to visualize the data, I am getting the following error:

Out[1]:

==> processing options
==> downloading dataset
==> using reduced training data, for fast experiments
==> loading dataset

Out[1]:

==> preprocessing data

Out[1]:

==> preprocessing data: colorspace RGB -> YUV

Out[1]:

==> preprocessing data: normalize each feature (channel) globally

Out[1]:

==> preprocessing data: normalize all three channels locally

expected arguments: [Generator] [double] [double] | DoubleTensor [Generator] [double] [double]
stack traceback:
[C]: at 0x7fcf1f980750
[C]: in function 'uniform'
...torch/install/share/lua/5.1/nn/SpatialConvolutionMap.lua:103: in function 'reset'
...torch/install/share/lua/5.1/nn/SpatialConvolutionMap.lua:73: in function '__init'
/home/vvaq/torch/install/share/lua/5.1/torch/init.lua:51: in function </home/vvaq/torch/install/share/lua/5.1/torch/init.lua:47>
[C]: in function 'SpatialConvolutionMap'
...all/share/lua/5.1/nn/SpatialSubtractiveNormalization.lua:35: in function '__init'
/home/vvaq/torch/install/share/lua/5.1/torch/init.lua:51: in function </home/vvaq/torch/install/share/lua/5.1/torch/init.lua:47>
[C]: in function 'SpatialSubtractiveNormalization'
...all/share/lua/5.1/nn/SpatialContrastiveNormalization.lua:23: in function '__init'
/home/vvaq/torch/install/share/lua/5.1/torch/init.lua:51: in function </home/vvaq/torch/install/share/lua/5.1/torch/init.lua:47>
...
[string "local f = function() return dofile '1_data.lu..."]:1: in main chunk
[C]: in function 'xpcall'
/home/vvaq/torch/install/share/lua/5.1/itorch/main.lua:177: in function </home/vvaq/torch/install/share/lua/5.1/itorch/main.lua:143>
/home/vvaq/torch/install/share/lua/5.1/lzmq/poller.lua:75: in function 'poll'
.../vvaq/torch/install/share/lua/5.1/lzmq/impl/loop.lua:307: in function 'poll'
.../vvaq/torch/install/share/lua/5.1/lzmq/impl/loop.lua:325: in function 'sleep_ex'
.../vvaq/torch/install/share/lua/5.1/lzmq/impl/loop.lua:370: in function 'start'
/home/vvaq/torch/install/share/lua/5.1/itorch/main.lua:344: in main chunk
[C]: in function 'require'
[string "arg={'/home/vvaq/.ipython/profile_default..."]:1: in main chunk

Did anyone have a similar problem?.
I have checked and reinstall components... everything seems OK. More details:

  • Ubuntu 14.04
  • python version is 2.7.6
  • ipython version is 3.1.0

Thank you for the help!

save torch code

Hi, I am new to torch, I am looking ways to save the code written in torch in linux shell,
i found there are ways to save code by .th, .net and .dat,
Can anybody explain me these file extensions and how I can save the whole code from " require 'nn'" to training dataset.

Thanks in aniticipation

Training for 2_supervised hung

Hi there,

I did a fresh install of torch on ubuntu 4.8.2 and I am running through the tutorials. I ran

th -i doall.lua

and it all seems to set up fine till it goes to training. Then it gets stuck here -

==> defining test procedure 
==> training!   
==> doing epoch on training data:   
==> online epoch # 1 [batchSize = 1]    
 [................................ 1/73257 ....................................] ETA: 0ms | Step: 0ms    

I have 3GB memory on this VM so that shouldn't be a problem. I see luajit taking 300% CPU (although each core seems relatively idle) and 44% memory.

I tried to run it a couple of times, and sometimes it gets a little further but it keeps getting stuck in the first epoch. What am I missing?

PS, it does work for mlp model, just not conv

Execution method for /5_newmodules/1_dropout.lua

I can't run /5_newmodules/1_dropout.lua with th. Should I run this file on iTorch notebook like this?

$ th 1_dropout.lua
original image: 
/home/twlee/torch/install/bin/luajit: 1_dropout.lua:18: attempt to index global 'itorch' (a nil value)
stack traceback:
    1_dropout.lua:18: in main chunk
    [C]: in function 'dofile'
    ...wlee/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:131: in main chunk
    [C]: at 0x00406670
$ itorch --version
4.0.1

Running issue in 3_unsupervised/doall.lua

Hello, Clement Farabet,

 I'm studying your Machine Learning with Torch7 tutorial and trying its torch7 code. Unfortunately, I could not run the code in section 3_unsupervised successfully (Pls see the following info).
Would you give me some hints to tackle this running error?

(My system configuration is ubuntu 13.04 desktop 64bit , Torch 7.0 installed, Torch packages (unsup, nn, etc..) installed )

Thanks and regards,
Milton

milton@milton-X230:~/Downloads/torch-tutorials-master/3_unsupervised$ torch -i doall.lua
Torch 7.0 Copyright (C) 2001-2011 Idiap, NEC Labs, NYU
Can not find any of the default terminals for linux you can manually set terminal by gnuplot.setterm("terminal-name")
-- ignore option dir
[program started on Sun 21 Jul 2013 06:48:47 PM EDT]
[command line arguments]
seed 1
statinterval 5000
datafile http://data.neuflow.org/data/tr-berkeley-N5K-M56x56-lcn.ascii
v false
lambda 1
beta 1
hessian true
maxhessian 500
kernelsize 9
inputsize 25
nfiltersin 1
etadecay 1e-05
rundir outputs/psd
model conv-psd
maxiter 1000000
eta 0.002
batchsize 1
nfiltersout 16
tied false
hessiansamples 500
threads 2
momentum 0
dir outputs
minhessian 0.02
hessianinterval 10000
display true
wcar
[----------------------]
==> constructing model
==> constructed convolutional predictive sparse decomposition (PSD) auto-encoder
==> training model
torch-qlua: /usr/local/share/torch/lua/unsup/psd.lua:39: attempt to call method 'initDiagHessianParameters' (a nil value)
stack traceback:
[C]: in function 'initDiagHessianParameters'
/usr/local/share/torch/lua/unsup/psd.lua:39: in function 'initDiagHessianParameters'
3_train.lua:7: in main chunk
[C]: in function 'dofile'
doall.lua:117: in main chunk
Lua 5.1 Copyright (C) 1994-2008 Lua.org, PUC-Rio

t7>

Sup learning can't execute with problem with SpatialSubtractiveNormalization

Hi,

I am trying to run supervised learning example with
th -i doall.lua
But I got error in the middle as following shown,

==> processing options
==> executing all
==> downloading dataset
==> using regular, full training data
==> loading dataset
==> preprocessing data
==> preprocessing data: colorspace RGB -> YUV
==> preprocessing data: normalize each feature (channel) globally
==> preprocessing data: normalize all three channels locally
/usr/local/bin/luajit: ...cal/share/lua/5.1/nn/SpatialSubtractiveNormalization.lua:49: attempt to index a number value
stack traceback:
...cal/share/lua/5.1/nn/SpatialSubtractiveNormalization.lua:49: in function '__init'
/usr/local/share/lua/5.1/torch/init.lua:50: in function </usr/local/share/lua/5.1/torch/init.lua:46>
[C]: in function 'SpatialSubtractiveNormalization'
...cal/share/lua/5.1/nn/SpatialContrastiveNormalization.lua:23: in function '__init'
/usr/local/share/lua/5.1/torch/init.lua:50: in function </usr/local/share/lua/5.1/torch/init.lua:46>
[C]: in function 'SpatialContrastiveNormalization'
1_data.lua:203: in main chunk
[C]: in function 'dofile'
doall.lua:67: in main chunk
[C]: in function 'dofile'
/usr/local/lib/luarocks/rocks/trepl/scm-1/bin/th:131: in main chunk
[C]: at 0x004061d0

I didn't make any changes to the source codes. Please help me with this issue. Thank you!

Install - unsup

Hi guys,
I think i managed to install unsup however It seems to be installing into my usr/local folder and when I try to call it seems it can't be found.
Any ideas?

Here's my error:
/Users/zSUGARBANK/torch/install/bin/luajit: ...rs/zSUGARBANK/torch/install/share/lua/5.1/trepl/init.lua:389: module 'unsup' not found:No LuaRocks module found for unsup

and here's my install log:

Christians-iMac:install zSUGARBANK$ luarocks install /Users/zSUGARBANK/Desktop/unsup-0.1-0.rockspec
Using /Users/zSUGARBANK/Desktop/unsup-0.1-0.rockspec... switching to 'build' mode
Cloning into 'unsup'...
remote: Counting objects: 39, done.
remote: Compressing objects: 100% (37/37), done.
remote: Total 39 (delta 5), reused 14 (delta 1), pack-reused 0
Unpacking objects: 100% (39/39), done.
Checking connectivity... done.
cmake -E make_directory build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="/usr/local/bin/.." -DCMAKE_INSTALL_PREFIX="/usr/local/lib/luarocks/rocks-5.2/unsup/0.1-0" && make

-- The C compiler identification is AppleClang 7.3.0.7030031
-- The CXX compiler identification is AppleClang 7.3.0.7030031
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Torch7 in /usr/local
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/luarocks_unsup-0.1-0-5870/unsup/build
Scanning dependencies of target unsup
[ 50%] Building C object CMakeFiles/unsup.dir/init.c.o
[100%] Linking C shared module libunsup.so
[100%] Built target unsup
cd build && make install
[100%] Built target unsup
Install the project...
-- Install configuration: "Release"
-- Installing: /usr/local/lib/luarocks/rocks-5.2/unsup/0.1-0/lib/libunsup.so
-- Installing: /usr/local/lib/luarocks/rocks-5.2/unsup/0.1-0/lua/unsup/AutoEncoder.lua
-- Installing: /usr/local/lib/luarocks/rocks-5.2/unsup/0.1-0/lua/unsup/ConvPsd.lua
-- Installing: /usr/local/lib/luarocks/rocks-5.2/unsup/0.1-0/lua/unsup/Diag.lua
-- Installing: /usr/local/lib/luarocks/rocks-5.2/unsup/0.1-0/lua/unsup/FistaL1.lua
-- Installing: /usr/local/lib/luarocks/rocks-5.2/unsup/0.1-0/lua/unsup/LinearFistaL1.lua
-- Installing: /usr/local/lib/luarocks/rocks-5.2/unsup/0.1-0/lua/unsup/LinearPsd.lua
-- Installing: /usr/local/lib/luarocks/rocks-5.2/unsup/0.1-0/lua/unsup/SparseAutoEncoder.lua
-- Installing: /usr/local/lib/luarocks/rocks-5.2/unsup/0.1-0/lua/unsup/SpatialConvFistaL1.lua
-- Installing: /usr/local/lib/luarocks/rocks-5.2/unsup/0.1-0/lua/unsup/UnsupModule.lua
-- Installing: /usr/local/lib/luarocks/rocks-5.2/unsup/0.1-0/lua/unsup/UnsupTrainer.lua
-- Installing: /usr/local/lib/luarocks/rocks-5.2/unsup/0.1-0/lua/unsup/init.lua
-- Installing: /usr/local/lib/luarocks/rocks-5.2/unsup/0.1-0/lua/unsup/kmeans.lua
-- Installing: /usr/local/lib/luarocks/rocks-5.2/unsup/0.1-0/lua/unsup/pca.lua
-- Installing: /usr/local/lib/luarocks/rocks-5.2/unsup/0.1-0/lua/unsup/psd.lua
-- Installing: /usr/local/lib/luarocks/rocks-5.2/unsup/0.1-0/lua/unsup/topo-kmeans.lua
-- Installing: /usr/local/lib/luarocks/rocks-5.2/unsup/0.1-0/lua/unsup/whitening.lua
Updating manifest for /usr/local/lib/luarocks/rocks-5.2
unsup 0.1-0 is now built and installed in /usr/local (license: BSD)

Guide for the poor, completely newbie

The completely newbie does not find anything trying to follow the link for the dead wiki page.
Besides, there's no installation guide on Torch.

Criticism or fact... I'm sorry... but I have to find some other tutorial somewhere else, cos this one is completely useless.

MSECriterion error with cuda and double types and MultiMarginCriterion error with cuda

Setting the mse criterion in doall.lua causes error when the types are cuda or double.
Settings:

cmd:option('-seed', 1, 'fixed input seed for repeatable experiments')
cmd:option('-threads', 8, 'number of threads')
-- data:
cmd:option('-size', 'full', 'how many samples do we load: small | full | extra')
-- model:
cmd:option('-model', 'convnet', 'type of model to construct: linear | mlp | convnet')
-- training:
cmd:option('-save', 'results', 'subdirectory to save/log experiments in')
cmd:option('-plot', false, 'live plot')
cmd:option('-optimization', 'SGD', 'optimization method: SGD | ASGD | CG | LBFGS')
cmd:option('-learningRate', 1e-3, 'learning rate at t=0')
cmd:option('-batchSize', 1, 'mini-batch size (1 = pure stochastic)')
cmd:option('-weightDecay', 0, 'weight decay (SGD only)')
cmd:option('-momentum', 0, 'momentum (SGD only)')
cmd:option('-t0', 1, 'start averaging at t0 (ASGD only), in nb of epochs')
cmd:option('-maxIter', 2, 'maximum nb of iterations for CG and LBFGS')

Error when the type is set to cuda:

/root/torch/install/share/lua/5.1/nn/THNN.lua:804: bad argument #3 to 'v' (cannot convert 'struct THFloatTensor *' to 'struct THCudaTensor *')
stack traceback:
    [C]: in function 'v'
    /root/torch/install/share/lua/5.1/nn/THNN.lua:804: in function 'MSECriterion_updateOutput'
    /root/torch/install/share/lua/5.1/nn/MSECriterion.lua:14: in function 'forward'
    4_train.lua:161: in function 'opfunc'
    /root/torch/install/share/lua/5.1/optim/sgd.lua:44: in function 'optimMethod'
    4_train.lua:184: in function 'train'
    doall.lua:80: in main chunk
    [C]: in function 'f'
    [string "local f = function() return dofile('doall.lua..."]:1: in main chunk
    [C]: in function 'xpcall'
    /root/torch/install/share/lua/5.1/itorch/main.lua:209: in function </root/torch/install/share/lua/5.1/itorch/main.lua:173>
    /root/torch/install/share/lua/5.1/lzmq/poller.lua:75: in function 'poll'
    /root/torch/install/share/lua/5.1/lzmq/impl/loop.lua:307: in function 'poll'
    /root/torch/install/share/lua/5.1/lzmq/impl/loop.lua:325: in function 'sleep_ex'
    /root/torch/install/share/lua/5.1/lzmq/impl/loop.lua:370: in function 'start'
    /root/torch/install/share/lua/5.1/itorch/main.lua:381: in main chunk
    [C]: in function 'require'
    (command line):1: in main chunk
    [C]: at 0x00405bd0


Error when set to double type:

/root/torch/install/share/lua/5.1/nn/THNN.lua:804: bad argument #3 to 'v' (cannot convert 'struct THFloatTensor *' to 'struct THDoubleTensor *')
stack traceback:
    [C]: in function 'v'
    /root/torch/install/share/lua/5.1/nn/THNN.lua:804: in function 'SpatialConvolutionMM_updateOutput'
    .../torch/install/share/lua/5.1/nn/SpatialConvolutionMM.lua:72: in function 'updateOutput'
    /root/torch/install/share/lua/5.1/nn/Sequential.lua:44: in function 'forward'
    4_train.lua:160: in function 'opfunc'
    /root/torch/install/share/lua/5.1/optim/sgd.lua:44: in function 'optimMethod'
    4_train.lua:184: in function 'train'
    doall.lua:80: in main chunk
    [C]: in function 'f'
    [string "local f = function() return dofile('doall.lua..."]:1: in main chunk
    [C]: in function 'xpcall'
    /root/torch/install/share/lua/5.1/itorch/main.lua:209: in function </root/torch/install/share/lua/5.1/itorch/main.lua:173>
    /root/torch/install/share/lua/5.1/lzmq/poller.lua:75: in function 'poll'
    /root/torch/install/share/lua/5.1/lzmq/impl/loop.lua:307: in function 'poll'
    /root/torch/install/share/lua/5.1/lzmq/impl/loop.lua:325: in function 'sleep_ex'
    /root/torch/install/share/lua/5.1/lzmq/impl/loop.lua:370: in function 'start'
    /root/torch/install/share/lua/5.1/itorch/main.lua:381: in main chunk
    [C]: in function 'require'
    (command line):1: in main chunk
    [C]: at 0x00405bd0

MultiMarginCriterion error with cuda:

/root/torch/install/share/lua/5.1/nn/THNN.lua:804: wrong number of arguments for function call
stack traceback:
    [C]: in function 'v'
    /root/torch/install/share/lua/5.1/nn/THNN.lua:804: in function 'MultiMarginCriterion_updateOutput'
    .../torch/install/share/lua/5.1/nn/MultiMarginCriterion.lua:19: in function 'forward'
    4_train.lua:161: in function 'opfunc'
    /root/torch/install/share/lua/5.1/optim/sgd.lua:44: in function 'optimMethod'
    4_train.lua:184: in function 'train'
    doall.lua:80: in main chunk
    [C]: in function 'f'
    [string "local f = function() return dofile('doall.lua..."]:1: in main chunk
    [C]: in function 'xpcall'
    /root/torch/install/share/lua/5.1/itorch/main.lua:209: in function </root/torch/install/share/lua/5.1/itorch/main.lua:173>
    /root/torch/install/share/lua/5.1/lzmq/poller.lua:75: in function 'poll'
    /root/torch/install/share/lua/5.1/lzmq/impl/loop.lua:307: in function 'poll'
    /root/torch/install/share/lua/5.1/lzmq/impl/loop.lua:325: in function 'sleep_ex'
    /root/torch/install/share/lua/5.1/lzmq/impl/loop.lua:370: in function 'start'
    /root/torch/install/share/lua/5.1/itorch/main.lua:381: in main chunk
    [C]: in function 'require'
    (command line):1: in main chunk
    [C]: at 0x00405bd0

When does OO syntax pass the Tensor as the resulting Tensor?

maths.md states:

"The Torch package adopts the same concept, so that calling a function directly on the Tensor itself using an object-oriented syntax is equivalent to passing the Tensor as the optional resulting Tensor. The following two calls are equivalent.

torch.log(x, x)
x:log()
"

However, this doesn't always seem to be the case. For example, if we call

x:cat(y), x.reshape(2,3), x:t()

then x does NOT change after the call. In particular, I can't see why x:add(y) changes x, while x:cat(y) doesn't.

So is there any rule on when a tensor will be changed by calling on itself in OO syntax? Thanks.

5_newmodules: gradient checking on the Dropout is showing large error

I added the Dropout layer (that is created in these tutorials) in my network and then created a code to check the gradient using finite differences. Without the Dropout layer, the difference is very less(order of 10e-6), but as I add the Dropout layer, the error increased a lot (0.9). I feel there is some error in dropout you implemented. I am a newbie in torch and i am trying to learn torch using https://github.com/oxford-cs-ml-2015/practical4 .

2_supervised error

this is the errror:

lua:78: attempt to index field 'file' (a nil value)
stack traceback:
    /home/ubuntu/torch/install/share/lua/5.1/optim/Logger.lua:78: in function 'add'
    4_train.lua:197: in function 'train'
    doall.lua:77: in main chunk
    [C]: in function 'dofile'
    ...untu/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:131: in main chunk
    [C]: at 0x00406670

gradParameters not being updated in feval function?

I wasn't able to figure out what is purpose of gradParameters in 2_suprvised/4_train.lua.
In definition of closure function, at line 152, is set to 0, and then, at line 173, is normalized without being previously set to any new values. Then, what is it for?

Cannot load the data 'tr-berkeley-N5K-M56x56-lcn.ascii'

obj=torch.load('tr-berkeley-N5K-M56x56-lcn.ascii','ascii')

gives me :

/home/olivier/torch/install/share/lua/5.1/torch/File.lua:270: read error: read 1 blocks instead of 15680000 at /home/olivier/torch/pkg/torch/lib/TH/THDiskFile.c:310
stack traceback:
[C]: in function 'read'
/home/olivier/torch/install/share/lua/5.1/torch/File.lua:270: in function </home/olivier/torch/install/share/lua/5.1/torch/File.lua:190>
[C]: in function 'read'
/home/olivier/torch/install/share/lua/5.1/torch/File.lua:270: in function 'readObject'
/home/olivier/torch/install/share/lua/5.1/torch/File.lua:311: in function 'load'
[string "obj=torch.load('tr-berkeley-N5K-M56x56-lcn.as..."]:1: in main chunk
[C]: in function 'xpcall'
/home/olivier/torch/install/share/lua/5.1/itorch/main.lua:179: in function </home/olivier/torch/install/share/lua/5.1/itorch/main.lua:143>
/home/olivier/torch/install/share/lua/5.1/lzmq/poller.lua:75: in function 'poll'
...e/olivier/torch/install/share/lua/5.1/lzmq/impl/loop.lua:307: in function 'poll'
...e/olivier/torch/install/share/lua/5.1/lzmq/impl/loop.lua:325: in function 'sleep_ex'
...e/olivier/torch/install/share/lua/5.1/lzmq/impl/loop.lua:370: in function 'start'
/home/olivier/torch/install/share/lua/5.1/itorch/main.lua:350: in main chunk
[C]: in function 'require'
[string "arg={'/run/user/1000/jupyter/kernel-9964e02c-..."]:1: in main chunk

bug in 2_supervised/1_data.lua when size='small'

The YUV conversion is done only on the first 10000 elements of trainData.data, but the global normalization is done across all elements (including those which are still RGB and which have a different mean/variance). Fix is to slice the training/test data when doing global normalization, and again when "verifying statistics."

As an aside, why do the comments state "luminance is locally normalized and color globally," when in fact local and global normalization is applied to all channels?

gfx.js

luarocks install gfx.js
produces errors on my Ubunu 14.04

Here are some

npm http 304 https://registry.npmjs.org/fsevents/0.2.0
npm WARN optional dep failed, continuing [email protected]

..

npm http 304 https://registry.npmjs.org/cookie-signature/1.0.1
/bin/sh: 1: node: not found
gyp: Call to 'node -e "require('nan')"' returned exit status 127. while trying to load binding.gyp
gyp ERR! configure error
npm http 304 https://registry.npmjs.org/debug
gyp ERR! stack Error: gyp failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/share/node-gyp/lib/configure.js:431:16)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:797:12)
gyp ERR! System Linux 3.13.0-32-generic
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /tmp/luarocks_gfx.js-scm-0-7846/gfx.js/node_modules/pty.js
gyp ERR! node -v v0.10.25
gyp ERR! node-gyp -v v0.10.10
gyp ERR! not ok
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm ERR! weird error 1
npm http 304 https://registry.npmjs.org/connect/2.11.0

..

npm http 304 https://registry.npmjs.org/inherits
npm ERR! not ok code 0
==> installing static resources into ~/.gfx.js/
==> installing torch client into /home/ihor/torch/install/bin/../share/lua/5.1/gfx/
==> Torch client installed globally, run me like this:
$ luajit -lgfx.start
or
$ luajit -lgfx.go
(this will start the gfx server automatically)
gfx command-line binary installed. Use it to display images quickly
$ gfx test.jpg
Updating manifest for /home/ihor/torch/install/lib/luarocks/rocks
gfx.js scm-0 is now built and installed in /home/ihor/torch/install/ (license: MIT)

then when I launch

ihor@ihor-VirtualBox:~$ luajit -lgfx.go
gm (GraphicsMagick) binary not found, please install (see www.graphicsmagick.org)
sh: 1: node: not found
[gfx.js] server started on port 8000, graphics will be rendered into http://localhost:8000
LuaJIT 2.1.0-alpha -- Copyright (C) 2005-2014 Mike Pall. http://luajit.org/


|_ | | |
| | ___ _ __ | |
| |/ _ | '**/ _| ' \
| | (
) | | | (| | | |
/
/|
| _**|| ||

JIT: ON SSE2 SSE3 fold cse dce fwd dse narrow loop abc sink fuse
th>
(process:10010): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed

and the gfx doesn't apper to work properly, though it loads a browser on "http://localhost:8000/" which it is "Unable to connect" to. Or if I launch differently,

ihor@ihor-VirtualBox:~$ luajit -lgfx.start
gm (GraphicsMagick) binary not found, please install (see www.graphicsmagick.org)
[gfx.js] server started on port 8000, graphics will be rendered into http://localhost:8000
sh: 1: node: not found

Things look a bit different under root. Firefox is launchd here aswell displaying the same.

root@ihor-VirtualBox:/home/ihor# luajit -lgfx.go
gm (GraphicsMagick) binary not found, please install (see www.graphicsmagick.org)
[gfx.js] server started on port 8000, graphics will be rendered into http://localhost:8000
sh: 1: node: not found

(process:10309): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed
1422546489939 addons.xpi WARN Add-on [email protected] is missing bootstrap method install

Note this

th> require 'gfx.js'
gm (GraphicsMagick) binary not found, please install (see www.graphicsmagick.org)
{
show : function: 0x41582d78
chart : function: 0x415830a8
redraw : function: 0x41583160
startserver : function: 0x41582ce8
template : "/home/ihor/.gfx.js/templates/"
templates : {...}
static : "/home/ihor/.gfx.js/static/data/"
list : function: 0x41582cc8
verbose : true
image : function: 0x4098b550
killserver : function: 0x41582d58
listservers : function: 0x41582d08
prefix : "/data/"
clear : function: 0x41583140
images : function: 0x41582f68
}

Note when it thinks it is working successfully (under root)

root@ihor-VirtualBox:/home/ihor# luajit -gfx.go
usage: luajit [options]... [script [args]...].
Available options are:
-e chunk Execute string 'chunk'.
-l name Require library 'name'.
-b ... Save or list bytecode.
-j cmd Perform LuaJIT control command.
-O[opt] Control LuaJIT optimizations.
-i Enter interactive mode after executing 'script'.
-v Show version information.
-E Ignore environment variables.
-- Stop handling options.

  •     Execute stdin and stop handling options.
    

root@ihor-VirtualBox:/home/ihor# luajit -lgfx.go
gm (GraphicsMagick) binary not found, please install (see www.graphicsmagick.org)
[gfx.js] server started on port 8000, graphics will be rendered into http://localhost:8000
sh: 1: node: not found

(process:10462): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed
LuaJIT 2.1.0-alpha -- Copyright (C) 2005-2014 Mike Pall. http://luajit.org/


|_ | | |
| | ___ _ __ | |
| |/ _ | '**/ _| ' \
| | (
) | | | (| | | |
/
/|
| _**|| ||

JIT: ON SSE2 SSE3 fold cse dce fwd dse narrow loop abc sink fuse
th> require 'gfx.js'
th> require 'image'
th> i=image.lena()
th> gfx
th>> .image(i)
[gfx.js] rendering cell <dom_1422546926079420629243124>
th>

but it's not, nothing happens, still "Unable to connect"

  • I was later able to resolve graphicsmagick error with:*
apt-get install graphicsmagick

from root

(Talking about the
gm (GraphicsMagick) binary not found, please install (see www.graphicsmagick.org)
error)

though previously, when the bugging happened, "luarocks list" showed me

graphicsmagick
   1.scm-0 (installed) - /home/ihor/torch/install/lib/luarocks/rocks

anyway.

This might be a worthy warning

npm WARN This failure might be due to the use of legacy binary "node"

Still get problems with

ihor@ihor-VirtualBox:~$ th -x
[gfx.js] server started on port 8000, graphics will be rendered into http://localhost:8000
sh: 1: node: not found
[gfx.js] clearing all cached graphics

(process:4116): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed

So it looks like it tries to find "node".
And still don't see anything initialized on my port.
Might be just a problem with virtualbox, though.

replace cunn by clnn?

The inn using cunn for speed up.
Why not replace cunn bu clnn?
So we can use gpu on Intel Iris Pro.

2_unsupervised and CUDA

if I run
torch -i doall.lua -type cuda

I get this error:
torch-qlua: /usr/local/share/torch/lua/nn/SpatialConvolutionMM.lua:42: attempt to call field 'SpatialConvolutionMM_updateOutput' (a nil value)
stack traceback:
[C]: in function 'SpatialConvolutionMM_updateOutput'
/usr/local/share/torch/lua/nn/SpatialConvolutionMM.lua:42: in function 'updateOutput'
/usr/local/share/torch/lua/nn/Sequential.lua:27: in function 'forward'
4_train.lua:157: in function 'opfunc'
/usr/local/share/torch/lua/optim/sgd.lua:36: in function 'optimMethod'
4_train.lua:181: in function 'train'
doall.lua:76: in main chunk

The code works fine if I use the default arguments.
Should I be using a different version of the tutorial?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.