Coder Social home page Coder Social logo

demos's Introduction

THIS REPOSITORY IS DEPRECEATED.

Please use https://github.com/torch/torch7

For install scripts, please look at: https://github.com/torch/ezinstall

Torch7 Library.

Torch7 provides a Matlab-like environment for state-of-the-art machine learning algorithms. It is easy to use and provides a very efficient implementation, thanks to an easy and fast scripting language (Lua) and a underlying C implementation.

In order to install Torch7 you can follow these simple instructions, but we suggest reading the detailed manual at http://www.torch.ch/manual/install/index

Requirements

  • C/C++ compiler
  • cmake
  • gnuplot
  • git

Optional

  • Readline
  • QT (QT4.8 is now supported)
  • CBLAS
  • LAPACK

Installation

$ git clone git://github.com/andresy/torch.git
$ cd torch
$ mkdir build
$ cd build

$ cmake .. 
OR
$ cmake .. -DCMAKE_INSTALL_PREFIX=/my/install/path

$make install

Running

$torch
Type help() for more info
Torch 7.0  Copyright (C) 2001-2011 Idiap, NEC Labs, NYU
Lua 5.1  Copyright (C) 1994-2008 Lua.org, PUC-Rio
t7> 

3rd Party Packages

Torch7 comes with a package manager based on Luarocks. With it it's easy to install new packages:

$ torch-rocks install image
$ torch-rocks list
$ torch-rocks search --all

Documentation

The full documentation is installed in /my/install/path/share/torch/html/index.html

Also, http://www.torch.ch/manual/index points to the latest documentation of Torch7.

demos's People

Contributors

andrewortman avatar atcold avatar clementfarabet avatar culurciello avatar grisson avatar jhjin avatar jtbates avatar marcoscoffier avatar mbajkowski avatar mheilman avatar rlowrance avatar robotsorcerer avatar samorajp avatar soumith avatar tommy-u avatar yosssi 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

demos's Issues

sys.filep has been deleted.

I think the function sys.filep was removed in sys 1.1-0 and it is being used here. Is it possible to have a list of the functions that were removed in sys 1.1-0 with descriptions so that I can find the replicates in paths, penlight or lfs and fix train-on-mnist.lua?

train-face-detector dataset not found

I tried running the face detector demo, but was unable to download the dataset.

Using wget http://data.neuflow.org/data/faces_cut_yuv_32x32.tar.gz I'm getting a 403 Forbidden, and using https://engineering.purdue.edu/elab/files/face-dataset.zip I'm getting a 404 Not Found.

I tried to find the files via web search, but couldn't get a working link.

bad argument passed to resizeAs in funtion forward line:84

/usr/local/share/lua/5.1/nn/CSubTable.lua:10: bad argument #1 to 'resizeAs' (torch.FloatTensor expected, got torch.DoubleTensor)
stack traceback:
[C]: in function 'resizeAs'
/usr/local/share/lua/5.1/nn/CSubTable.lua:10: in function 'updateOutput'
...cal/share/lua/5.1/nn/SpatialSubtractiveNormalization.lua:89: in function 'updateOutput'
/usr/local/share/lua/5.1/nn/Sequential.lua:44: in function 'forward'
...cal/share/lua/5.1/nn/SpatialContrastiveNormalization.lua:29: in function 'forward'
data.lua:184: in main chunk

Convolution layers lose col/row: train-a-digit-classifier/train-on-mnist.lua

I believe the first max pooling layer destroys 1 row and 1 col of data.
The input was 32x32 tensor, and after applying SpatialConvolutionMM(1, 32, 5, 5) we recovered a 32x28x28 tensor. Running SpatialMaxPooling(3, 3, 3, 3) should miss the last row and column of the 28x28 feature maps.

I tried to fix this by changing the pooling step to SpatialMaxPooling(3, 3, 3, 3, 2, 2 ), but recovered the error:
...lua/5.1/nn/THNN.lua:109: bad argument # 2 to 'v' (pad should be smaller than half of kernel size at /tmp/luarocks_nn-scm-1-2785 /nn/lib/THNN/generic/SpatialMaxPooling.c:108)

Can this be fixed simply by padding the pooling step? There's a similar loss of a row and col in the 2nd pooling step in this file.

error with luarocks install camera

I am not sure whether this is caused by library imcompatibility, because I am currently using opencv3.2.

Installing https://raw.githubusercontent.com/torch/rocks/master/camera-1.1-0.rockspec...
Using https://raw.githubusercontent.com/torch/rocks/master/camera-1.1-0.rockspec... switching to 'build' mode
Cloning into 'lua---camera'...
remote: Counting objects: 29, done.
remote: Compressing objects: 100% (28/28), done.
remote: Total 29 (delta 3), reused 10 (delta 0), pack-reused 0
Receiving objects: 100% (29/29), 18.57 KiB | 0 bytes/s, done.
Resolving deltas: 100% (3/3), done.
Checking connectivity... done.
cmake -E make_directory build;
cd build;
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="/home/cjliux/.local_install/torch/install/bin/.." -DCMAKE_INSTALL_PREFIX="/home/cjliux/.local_install/torch/install/lib/luarocks/rocks/camera/1.1-0";
make

-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /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: /usr/bin/c++
-- Check for working CXX compiler: /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 /home/cjliux/.local_install/torch/install
-- Found CUDA: /usr/local/cuda-8.0 (found suitable exact version "8.0")
-- Found OpenCV: /usr/local (found version "3.2.0")
-- Try OpenMP C flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Success
-- Try OpenMP CXX flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Success
-- Found OpenMP: -fopenmp
-- OpenMP Found with compiler flag : -fopenmp
CMake Warning at video4linux/CMakeLists.txt:13 (FIND_PACKAGE):
By not providing "FindARM.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "ARM", but
CMake did not find one.

Could not find a package configuration file provided by "ARM" with any of
the following names:

ARMConfig.cmake
arm-config.cmake

Add the installation prefix of "ARM" to CMAKE_PREFIX_PATH or set "ARM_DIR"
to a directory containing one of the above files. If "ARM" provides a
separate development package or SDK, be sure it has been installed.

-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/luarocks_camera-1.1-0-4873/lua---camera/build
Scanning dependencies of target camopencv
[ 25%] Building C object opencv/CMakeFiles/camopencv.dir/opencv.c.o
/tmp/luarocks_camera-1.1-0-4873/lua---camera/opencv/opencv.c:33:8: error: unknown type name ‘CvCapture’
static CvCapture* capture[MAXIDX];
^
/tmp/luarocks_camera-1.1-0-4873/lua---camera/opencv/opencv.c: In function ‘l_initCam’:
/tmp/luarocks_camera-1.1-0-4873/lua---camera/opencv/opencv.c:51:21: warning: implicit declaration of function ‘cvCaptureFromCAM’ [-Wimplicit-function-declaration]
capture[fidx] = cvCaptureFromCAM(idx);
^
/tmp/luarocks_camera-1.1-0-4873/lua---camera/opencv/opencv.c:51:19: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
capture[fidx] = cvCaptureFromCAM(idx);
^
/tmp/luarocks_camera-1.1-0-4873/lua---camera/opencv/opencv.c:58:19: warning: implicit declaration of function ‘cvQueryFrame’ [-Wimplicit-function-declaration]
frame[fidx] = cvQueryFrame ( capture[fidx] );
^
/tmp/luarocks_camera-1.1-0-4873/lua---camera/opencv/opencv.c:58:17: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
frame[fidx] = cvQueryFrame ( capture[fidx] );
^
/tmp/luarocks_camera-1.1-0-4873/lua---camera/opencv/opencv.c:64:19: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
frame[fidx] = cvQueryFrame ( capture[fidx] );
^
/tmp/luarocks_camera-1.1-0-4873/lua---camera/opencv/opencv.c:79:21: warning: implicit declaration of function ‘cvCreateFileCapture’ [-Wimplicit-function-declaration]
capture[fidx] = cvCreateFileCapture(file);
^
/tmp/luarocks_camera-1.1-0-4873/lua---camera/opencv/opencv.c:79:19: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
capture[fidx] = cvCreateFileCapture(file);
^
/tmp/luarocks_camera-1.1-0-4873/lua---camera/opencv/opencv.c: In function ‘l_grabFrame’:
/tmp/luarocks_camera-1.1-0-4873/lua---camera/opencv/opencv.c:98:14: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
frame[idx] = cvQueryFrame ( capture[idx] );
^
/tmp/luarocks_camera-1.1-0-4873/lua---camera/opencv/opencv.c: In function ‘l_releaseCam’:
/tmp/luarocks_camera-1.1-0-4873/lua---camera/opencv/opencv.c:130:3: warning: implicit declaration of function ‘cvReleaseCapture’ [-Wimplicit-function-declaration]
cvReleaseCapture( &capture[idx] );
^
opencv/CMakeFiles/camopencv.dir/build.make:62: recipe for target 'opencv/CMakeFiles/camopencv.dir/opencv.c.o' failed
make[2]: *** [opencv/CMakeFiles/camopencv.dir/opencv.c.o] Error 1
CMakeFiles/Makefile2:85: recipe for target 'opencv/CMakeFiles/camopencv.dir/all' failed
make[1]: *** [opencv/CMakeFiles/camopencv.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

Error: Build error: Failed building.

segmentation fault

I get the segmentation fault:

BLAS: program is terminated. because you tried to allocate too many memory regions.

happens somewhere in the train-function. any ideas how to fix it?

CUDA version of the train-on-cifar.lua

Has any one done train-on-cifar for CUDA? I tried converting this to CUDA version from CPU version which is given, by doing this:

if opt.network == '' then
-- define model to train
model = nn.Sequential()
model:add(nn.Copy('torch.FloatTensor','torch.CudaTensor'):cuda())

and then:

-- load dataset
trainData = {
data = torch.CudaTensor(50000, 3072),
labels = torch.CudaTensor(50000),
size = function() return trsize end
}

But it gives the following error:

preprocessing data (color space + normalization)
/usr6/prakash/DNN/Torch/luajit-rocks/bin/luajit: ...sh/DNN/Torch/luajit-rocks/share/lua/5.1/nn/CSubTable.lua:10: bad argument #1 to 'resizeAs' (torch.DoubleTensor expected, got torch.CudaTensor)
stack traceback:
[C]: in function 'resizeAs'
...sh/DNN/Torch/luajit-rocks/share/lua/5.1/nn/CSubTable.lua:10: in function 'updateOutput'
...cks/share/lua/5.1/nn/SpatialSubtractiveNormalization.lua:89: in function 'updateOutput'
...h/DNN/Torch/luajit-rocks/share/lua/5.1/nn/Sequential.lua:44: in function 'forward'
...cks/share/lua/5.1/nn/SpatialContrastiveNormalization.lua:29: in function 'forward'
...akash/DNN/Torch/luajit-rocks/share/lua/5.1/nn/Module.lua:276: in function <...akash/DNN/Torch/luajit-rocks/share/lua/5.1/nn/Module.lua:275>
[C]: in function 'normalization'
train-on-cifar-cuda.lua:193: in main chunk
[C]: in function 'dofile'
...Torch/luajit-rocks/lib/luarocks/rocks/trepl/scm-1/bin/th:131: in main chunk
[C]: at 0x004051e0

I also tried setdefaultTensor type to float (as suggested in another thread), but that does not work either.

Thanks for any suggestions.

Prakash

train-autoencoder demo fails

After a fresh install of torch7 and the unsup rocks, running the train-autoencoder (th train-autoencoder.lua) demonstration ends with the following error

==> constructed convolutional predictive sparse decomposition (PSD) auto-encoder
/usr/local/bin/luajit: /usr/local/share/lua/5.1/unsup/psd.lua:39: attempt to call method 'initDiagHessianParameters' (a nil value)
stack traceback:
    /usr/local/share/lua/5.1/unsup/psd.lua:39: in function 'initDiagHessianParameters'
    train-autoencoder.lua:225: in main chunk
    [C]: in function 'dofile'
    /usr/local/lib/luarocks/rocks/trepl/scm-1/bin/th:108: in main chunk
    [C]: at 0x00404ec4

any idea on how to fix this ?

Help! CAN NOT LOAD more than 70 images?

I simply run the load-images.lua and tried to load 150 images from another folder.

However, I found that my computer will be very slow when the loaded image number up to 70. Then my computer is dead. [ I added " print('Get #'..i) " in "-- load each image" for-loop to know the exact loaded number.]

-- Go over the file list:
images = {}
for i,file in ipairs(files) do
-- load each image
table.insert(images, image.load(file))
print('Get #'..i)
end

I tried to reboot and even add "collectgarbage()", but none ot them worked.

If I just load a few images, like 10 or 20 images, then everything is perfect.
I want to know how to fix this problem?

how to set nstates and filtsize in recognize face

I see convolution in the code below to classify faces: (image 32x32).
He used nstates={16, 32}, filtersize={5,7}, poolsize=4 for image 32x32
screen shot 2016-05-23 at 11 46 26

These parameters are for image 32x32. I am wondering what number we could use if the size of image are 128x128, 256x256,...?
Please help me.
Thank you

Tracker demo instructions

I've tried to run the 'tracker' demo with a video as input, and this is the command I used:

qlua run.lua --source video -v /<path to video>/video.avi -r 30 -l 37

This is the corresponding output:

ffmpeg -i /home/yanma/Desktop/follow_car.avi -r 30 -t 37 -map 0:v:0 -s 640x480 -qscale 1 /home/yanma/LibSrc/torch_demo/tracker/scratch/follow_car.avi_30fps_640x480_37s_c0_sk0_png/frame-%06d.png 2> /dev/null
Using frames in /home/yanma/LibSrc/torch_demo/tracker/scratch/follow_car.avi_30fps_640x480_37s_c0_sk0_png/frame-%06d.png
clearing video
rm -rf /home/yanma/LibSrc/torch_demo/tracker/scratch/follow_car.avi_30fps_640x480_37s_c0_sk0_png
 ... input window of convnet is 3x22x22 in size
 ... image downsampling ratio = 2
 ... calibrating encoder so as to produce a single vector for a training patch of width 64 and height 64
 ... appending a 11x11 L2-pooling
 ... encoder global downsampling ratio = 4

./source.lua:79: attempt to call method 'min' (a nil value)
stack traceback:
    ./source.lua:79: in function 'getframe'
    ./process.lua:98: in function 'process'
    ./state.lua:45: in function 'loop'
    ./display.lua:191: in function <./display.lua:176>

I believe that the source.rawFrame is a torch.Tensor, which should have a 'min' operator in it.

Any tip would be much appreciated!

Wrongly reporting mean class accuracy

In the CNN demo's (cifar, housenumbers, and digit-classifier) the performance is reported in the form of the mean class accuracy. However this is done using confusion.totalValid, which is the total accuracy, not the mean class accuracy. The mean class accuracy can be found in confusion.averageValid.

totalValid is the sum of the diagonal of the confusion matrix divided by the sum of the matrix. averageValid is the average of all diagonals divided by their respective rows.

Is the intention to report the accuracy and is the text wrong or is the wrong variable used? My guess would be the latter.

require 'data': module data not found

Hello,

I am very new to the Torch and I am using the help of this to work on my own dataset. But I couldn't handle the data task. Can anyone help?

Tracker is slow

Hi guys,

I tried demo https://github.com/torch/demos/tree/master/tracker and it is quite slow, I am experimenting now with real-time tracking of 4 camera streams, my intel core i7 with 8 threads is running at about 60-80% cpu load, but even using single camera is very slow. Any hints regarding performance?

In general all the demos not lightning fast if I compare it to my experiments with OpenCV processing. Is it even good idea to use Torch for realtime monitoring and tracking of about 20 objects by using 4 camera streams?

Thanks for any hints.

Ladislav

ConvNet Model in MNIST training does not converge

Don't know how to concise explaning it, when I train with Linear model, the global correctness is 80% the first time. However, in Convnet, the confusion matrix is basically predicting everything to be 1(the first class), any help in this please?

person-detector: PyramidUnPacker failed for 100*100 object detection

Hi,

I'm reusing person-detector for a new object detection problem. The object size is 100 by 100 instead of 46 by 46. I've replaced the 46's in model.lua and PyramidUnpacker.lua with 100's. The training process seems OK and I've got the model.net.

However, when I run rundemo.lua, the following error occurred:
/usr/local/bin/luajit: ./PyramidUnPacker.lua:97: bad argument #4 to 'narrow' (out of range)
stack traceback:
[C]: in function 'narrow'
./PyramidUnPacker.lua:97: in function 'forward'
rundemo.lua:108: in function 'process'
rundemo.lua:164: in main chunk
[C]: in function 'dofile'
/usr/local/lib/luarocks/rocks/trepl/scm-1/bin/th:129: in main chunk
[C]: at 0x00404b50

The hyper-parameters I used in model.lua:
-- input dimensions:
18 local nfeats = 3
19 local width = 100
20 local height = 100
21
22 -- hidden units, filter sizes (for ConvNet only):
23 local nstates = {32,64,128,128}
24 local filtsize = {11,11,10}
25 local poolsize1 = 3
26 local poolsize = 2

Would anyone please have a look at this?

Thanks
Tao

Person detection error

Hi, ii received following error

lua/5.1/xlua/init.lua:321: <ffmpeg.Video> file INRIAPerson/bg.m4v could not be found
stack traceback:
[C]: in function 'error'
/home/raak/torch/install/share/lua/5.1/trepl/init.lua:384: in function 'require'
run.lua:49: in main chunk
[C]: in function 'dofile'
...raak/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
[C]: at 0x00406670

lapp

What is this lapp you are using in here? Is it a function with no parenthesis? How does it parse the input?

Thanks

person tracker demo error

In th run.lua I obtain the following error:

==> processing options
==> load modules
==> downloading dataset
==> creating a new dataset from raw files:
ffmpeg -i INRIAPerson/bg.m4v -r 30 -t 10 -map 0:v:0 -s 142x80 -qscale 1 path/to/torch-demos/person-detector/scratch/bg.m4v_30fps_142x80_10s_c0_sk0_png/frame-%06d.png 2> /dev/null
Using frames in path/to/torch-demos/person-detector/scratch/bg.m4v_30fps_142x80_10s_c0_sk0_png/frame-%06d.png
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
image.load

loads an image into a torch.Tensor

> usage:
image.load(
    string                              -- path to file
    [number]                            -- force destination depth: 1 | 3
    [string]                            -- type: byte | float | double
)

/usr/lib64/lua/5.1/libpng.so: undefined symbol: png_set_longjmp_fn on train-face-detector demo

While stabilizing Gentoo ebuild packages for whole Torch stack I moved ahead by being able to execute some of the demos, but facing this issue with train-face-detector demo:

==> loading dataset	
/usr/share/lua/5.1/trepl/init.lua:389: error loading module 'libpng' from file '/usr/lib64/lua/5.1/libpng.so':
	/usr/lib64/lua/5.1/libpng.so: undefined symbol: png_set_longjmp_fn	
warning: <libpng> could not be loaded (is it installed?)	
==> downloading dataset	
==> loading dataset	
/usr/share/lua/5.1/trepl/init.lua:389: error loading module 'libpng' from file '/usr/lib64/lua/5.1/libpng.so':
	/usr/lib64/lua/5.1/libpng.so: undefined symbol: png_set_longjmp_fn	
warning: <libpng> could not be loaded (is it installed?)	
luajit: /usr/share/lua/5.1/trepl/init.lua:389: /usr/share/lua/5.1/dok/inline.lua:738: <image.loadPNG> libpng package not found, please install libpng
stack traceback:
	[C]: in function 'error'
	/usr/share/lua/5.1/trepl/init.lua:389: in function 'require'
	run.lua:50: in main chunk
	[C]: in function 'dofile'
	/usr/bin/th:150: in main chunk
	[C]: at 0x004045a0
zangetsu@ares ~/data/proj/neural-networks/torch-demos/train-face-detector $ ls -la /usr/lib64/lua/5.1/libpng.so
-rwxr-xr-x 1 root root 39376 11. Jan 20.17 /usr/lib64/lua/5.1/libpng.so
zangetsu@ares ~/data/proj/neural-networks/torch-demos/train-face-detector $ 

My ebuilds are not yet stabilized to some versions/commits, but uses latest available dev code in master branches.

inconsistent tensor size error

When I tried to replace inputs and targets with torch.Tensor in train module, luajit returned this error at criterion:backward(output,targets[i].
I've checked that output is a tensor while targets[i] is a number, but the same code work just fine in train-on-cifar.
Even thought in torch7 GoogleGroup's discussion, SMW said the repeatedly use of same instance of nonlinearity will lead to this error, I'm still confused about the cause and I don't think the nonliearity unit is the cause.
Can anyone help me? thanks~

average loss = nan

When training a convolutional autoencoder without the Hessian information (in train-autoencoder.lua), it looks like the average losses are equal to nan; what exactly does the Hessian information bring about? After a while, when training the convolutional autoencoder with Hessian information, the loss turns to nan. Is this expected?

Demo Data Pre-Processing Process

Could we please explain the pre-processing done on the datasets that are downloaded from the AWS servers? In particular the MNIST and CIFAR datasets. Would be useful to train a model and be able to test it on new 'unseen' data.

I need the rgb to yuv script, but it doesn't work.

I want to run with my own image datas.

So, I need the rgb to yuv script,

But your script doesn't work.

What's wrong in my trial?

/Users/sgi/work_torch/distro-cl/install/bin/luajit: bad argument #2 to '?' (out of range at /Users/sgi/work_torch/distro-cl/pkg/torch/generic/Tensor.c:888)
stack traceback:
[C]: at 0x0bf968f0
[C]: in function '__index'
data.lua:148: in main chunk
[C]: in function 'dofile'
.../distro-cl/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
[C]: at 0x010bc4ece0

Kinect missing

In order to try live-kinect demo, I had to install kinect module.
But it's impossible to install Kinect with luarocks : Error: No results matching query were found.
Does someone have a solution to install kinect? Thank you very much

Torch ffi is depracated on person detector

I tried to run qlua rundemo.lua on person-detector. While pulled in refferenced FFI package the error changed to:

zangetsu@ares ~/data/proj/neural-networks/torch-demos/person-detector $ qlua rundemo.lua 
WARNING: 'torchffi' is now deprecated. All of its functionality has been
merged/integrated into 'torch'.

qlua: /usr/share/lua/5.1/torchffi/init.lua:68: declaration specifier expected near 'deserializefrom' at line 27
stack traceback:
	[C]: at 0x7f27f8a0f340
	[C]: in function 'cdef'
	/usr/share/lua/5.1/torchffi/init.lua:68: in main chunk
	[C]: in function 'require'
	rundemo.lua:18: in main chunk

The file executed
Regards,

Ladislav

CMake error

I'm trying to build torch demos, but I'm facing the following CMake error:

CMake Error at CMakeLists.txt:6 (ADD_TORCH_DOK):
Unknown CMake command "ADD_TORCH_DOK".

train-on-cifar.lua -visualize broken

Looks like the layer numbers changed without the display() being updated: model:get(2/4).weight == nil, causing image.display() on line 239 to throw.

CUDA version of the train-on-cifar.lua

Do we have CUDA version for this train-on-cifar.lua? I did the following:

  1. Change as follows:
    -- load dataset
    torch.setdefaulttensortype("torch.CudaTensor")
    trainData = {
    data = torch.CudaTensor(50000, 3072), <== changed from torch.Tensor
    labels = torch.CudaTensor(50000),
  2. Similar changes for "mlp" model case too.

But it gives the error saying:

preprocessing data (color space + normalization)
/usr6/prakash/DNN/Torch/luajit-rocks/bin/luajit: invalid arguments: number number
expected arguments: CudaTensor [float] [float]
stack traceback:
[C]: at 0x7f2bb2949010
[C]: in function 'uniform'
.../luajit-rocks/share/lua/5.1/nn/SpatialConvolutionMap.lua:103: in function 'reset'
.../luajit-rocks/share/lua/5.1/nn/SpatialConvolutionMap.lua:73: in function '__init'
...kash/DNN/Torch/luajit-rocks/share/lua/5.1/torch/init.lua:54: in function <...kash/DNN/Torch/luajit-rocks/share/lua/5.1/torch/init.lua:50>
[C]: in function 'SpatialConvolutionMap'
...cks/share/lua/5.1/nn/SpatialSubtractiveNormalization.lua:35: in function '__init'
...kash/DNN/Torch/luajit-rocks/share/lua/5.1/torch/init.lua:54: in function <...kash/DNN/Torch/luajit-rocks/share/lua/5.1/torch/init.lua:50>
[C]: in function 'SpatialSubtractiveNormalization'
...cks/share/lua/5.1/nn/SpatialContrastiveNormalization.lua:23: in function '__init'
...kash/DNN/Torch/luajit-rocks/share/lua/5.1/torch/init.lua:54: in function <...kash/DNN/Torch/luajit-rocks/share/lua/5.1/torch/init.lua:50>
[C]: in function 'SpatialContrastiveNormalization'
train-on-cifar-cuda.lua:187: in main chunk
[C]: in function 'dofile'
...Torch/luajit-rocks/lib/luarocks/rocks/trepl/scm-1/bin/th:131: in main chunk
[C]: at 0x004051e0

demos contain errors, please fix them or indicate how we can fix them

hi everyone, so I just cloned the demos repo and run the digit recognizer example out of the box without modifying anything.

th train-on-mnist.lua -f -p -o "LBFGS" -b 256 -t 8

And this is what I get. After searching online I've found similar problems where they say that the solution is to remove labels with zero values. But in this case I don't know where that might come from since I've checked the labels min and max values and there are no zeros.

PANIC: unprotected error in call to Lua API (...tro/torch/install/share/lua/5.1/nn/ClassNLLCriterion.lua:49: Assertion `cur_target >= 0 && cur_target < n_classes' failed.  at /home/user/torch/extra/nn/lib/THNN/generic/ClassNLLCriterion.c:57
stack traceback:
    [C]: in function '__index'
    ...tro/torch/install/share/lua/5.1/nn/ClassNLLCriterion.lua:49: in function 'forward'
    train-on-mnist.lua:209: in function 'opfunc'
    /home/jmitro/torch/install/share/lua/5.1/optim/lbfgs.lua:66: in function 'lbfgs'
    train-on-mnist.lua:245: in function 'train'
    train-on-mnist.lua:345: in main chunk
    [C]: in function 'dofile'
    ...itro/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
    [C]: at 0x00405d50)

My guess is that the problem is here:

 -- create mini batch
      local inputs = torch.Tensor(opt.batchSize,1,geometry[1],geometry[2])
      local targets = torch.Tensor(opt.batchSize)
      local k = 1
      for i = t,math.min(t+opt.batchSize-1,dataset:size()) do
         -- load new sample
         local sample = dataset[i]
         local input = sample[1]:clone()
         local _,target = sample[2]:clone():max(1)
         target = target:squeeze()
         inputs[k] = input
         targets[k] = target
         k = k + 1
      end

If I print targets just before the error occurs it outputs all zeros and some nan values

bad argument #2 to '?' (out of range at at /home/dazhen/torch/pkg/torch/generic/Tensor.c:853)

hi~I ran the demo train-a-digit-classifier, and found when I set the batchsize more bigger,like 300, the procedure occured an error of out of range.
Actually, I also noticed the torch/optim project is updated for some simlar errors, but after I updated the optim page using "luarocks install optim", it still didn't work.
So, how can I fix this problem for big batchsize.By the way, I am kind of confusion about the ConfusionMatrix;what's the effect of the matrix?

Using Cuda with train-a-digit-classifier

Hi,

I have used the train-a-digit-classifier in a CPU mode and it is worked well. but now I want to test it in a GPU mode. I have a NVIDIA JETSON TK1 where I have installed CUDA 6.5 and all other prerequisites. I have also installed Torch7 and the two packages: Cutorch and Cunn.

In some tutorials, they say that for using the GPU mode with CUDA, there are only some lines of code to add:

require 'cunn'
In order to use CUDA

model:cuda()
to convert the nn to CUDA

But when I run: qlua train-on-mnist.lua I get some errors. Can you help me ?

Regards.

person-detector camera error

I was able to run qlua run.lua --visualize successfully, but the rundemo.lua is failing. Initially, I ran into a deprecated issue and commented out the require 'torchffi' line. I'm not sure if I am running into what might be a camera (Sony Playstation Eye) related issue running the demo (see below).

nvidia@tegra-ubuntu:~/demos/person-detector$ qlua rundemo.lua -c 0
==> processing options
Neural Network used:
nn.Sequential {
[input -> (1) -> (2) -> (3) -> (4) -> (5) -> (6) -> (7) -> (8) -> output]
(1): nn.SpatialConvolutionMM(3 -> 32, 7x7, 1,1)
(2): nn.Threshold
(3): nn.SpatialMaxPooling(2x2, 2,2)
(4): nn.SpatialConvolutionMM(32 -> 64, 7x7, 1,1)
(5): nn.Threshold
(6): nn.SpatialMaxPooling(2x2, 2,2)
(7): nn.SpatialConvolutionMM(64 -> 128, 7x7, 1,1)
(8): nn.SpatialClassifier
}
Initializing device: /dev/video0
FPS wanted 1
Using 1 buffers
Warning: camera resolution changed to 240x320
camera[0] started : 1
./PyramidUnPacker.lua:97: bad argument #2 to 'narrow' (out of range at /home/nvidia/torch/pkg/torch/lib/TH/generic/THTensor.c:438)
stack traceback:
[C]: in function 'narrow'
./PyramidUnPacker.lua:97: in function 'forward'
rundemo.lua:129: in function 'process'
rundemo.lua:183: in function rundemo.lua:180

person-detector: dataset URL is broken

The person-detector demo tries to fetch the dataset from a nonexistent URL:

$ wget https://engineering.purdue.edu/elab/files/INRIAPerson.zip
--2015-05-20 16:05:01--  https://engineering.purdue.edu/elab/files/INRIAPerson.zip
Resolving engineering.purdue.edu (engineering.purdue.edu)... 128.46.104.5
Connecting to engineering.purdue.edu (engineering.purdue.edu)|128.46.104.5|:443... connected.
HTTP request sent, awaiting response... 404 Not Found

Cannot run facedetector

How can I run the file run.lua in the facedetector demo?
I should run it with qlua that has qt packege preloaded of course. So:

qlua run.lua
qlua: /usr/local/share/lua/5.1/inline/init.lua:120: attempt to concatenate local 'path' (a nil value)

So I tried qlua first and then If I do : require 'inline' the first time it gives me the same error, the second time it works. (why?) . Anyway after I run it:

dofile 'run.lua'
run.lua:69: attempt to call field 'load' (a nil value)

No matter what it gaves me the error above.
Thank you for helping

train-a-digit-classifier demo fails

when trying to run the above mentioned demo the output error is this :

/usr/local/bin/luajit: /usr/local/share/lua/5.1/torch/File.lua:232: read error: read 30329738 blocks instead of 61440000
stack traceback:
[C]: in function 'read'
/usr/local/share/lua/5.1/torch/File.lua:232: in function </usr/local/share/lua/5.1/torch/File.lua:163>
[C]: in function 'read'
/usr/local/share/lua/5.1/torch/File.lua:232: in function 'readObject'
/usr/local/share/lua/5.1/torch/File.lua:248: in function 'readObject'
/usr/local/share/lua/5.1/torch/File.lua:271: in function 'load'
./dataset-mnist.lua:30: in function 'loadTrainSet'
backup.lua:149: in main chunk
[C]: in function 'dofile'
/usr/local/lib/luarocks/rocks/trepl/scm-1/bin/th:129: in main chunk
[C]: at 0x004061d0

Thank you

How to communicate between torch and some other program language?

Torch and it's extension is very good for design, train and test models, It is convenient and fast, but after all this procedure, I need to put my models into services, how could I communicate between torch and some other languages, like java, python, C#, etc.

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.