Giter Club home page Giter Club logo

deepmask's Introduction

Introduction

This repository contains a Torch implementation for both the DeepMask and SharpMask object proposal algorithms.

teaser

DeepMask is trained with two objectives: given an image patch, one branch of the model outputs a class-agnostic segmentation mask, while the other branch outputs how likely the patch is to contain an object. At test time, DeepMask is applied densely to an image and generates a set of object masks, each with a corresponding objectness score. These masks densely cover the objects in an image and can be used as a first step for object detection and other tasks in computer vision.

SharpMask is an extension of DeepMask which generates higher-fidelity masks using an additional top-down refinement step. The idea is to first generate a coarse mask encoding in a feedforward pass, then refine this mask encoding in a top-down pass using features at successively lower layers. This result in masks that better adhere to object boundaries.

If you use DeepMask/SharpMask in your research, please cite the relevant papers:

@inproceedings{DeepMask,
   title = {Learning to Segment Object Candidates},
   author = {Pedro O. Pinheiro and Ronan Collobert and Piotr Dollár},
   booktitle = {NIPS},
   year = {2015}
}
@inproceedings{SharpMask,
   title = {Learning to Refine Object Segments},
   author = {Pedro O. Pinheiro and Tsung-Yi Lin and Ronan Collobert and Piotr Dollár},
   booktitle = {ECCV},
   year = {2016}
}

Note: the version of DeepMask implemented here is the updated version reported in the SharpMask paper. DeepMask takes on average .5s per COCO image, SharpMask runs at .8s. Runtime roughly doubles for the "zoom" versions of the models.

Requirements and Dependencies

Quick Start

To run pretrained DeepMask/SharpMask models to generate object proposals, follow these steps:

  1. Clone this repository into $DEEPMASK:

    DEEPMASK=/desired/absolute/path/to/deepmask/ # set absolute path as desired
    git clone [email protected]:facebookresearch/deepmask.git $DEEPMASK
  2. Download pre-trained DeepMask and SharpMask models:

    mkdir -p $DEEPMASK/pretrained/deepmask; cd $DEEPMASK/pretrained/deepmask
    wget https://dl.fbaipublicfiles.com/deepmask/models/deepmask/model.t7
    mkdir -p $DEEPMASK/pretrained/sharpmask; cd $DEEPMASK/pretrained/sharpmask
    wget https://dl.fbaipublicfiles.com/deepmask/models/sharpmask/model.t7
  3. Run computeProposals.lua with a given model and optional target image (specified via the -img option):

    # apply to a default sample image (data/testImage.jpg)
    cd $DEEPMASK
    th computeProposals.lua $DEEPMASK/pretrained/deepmask # run DeepMask
    th computeProposals.lua $DEEPMASK/pretrained/sharpmask # run SharpMask
    th computeProposals.lua $DEEPMASK/pretrained/sharpmask -img /path/to/image.jpg

Training Your Own Model

To train your own DeepMask/SharpMask models, follow these steps:

Preparation

  1. If you have not done so already, clone this repository into $DEEPMASK:

    DEEPMASK=/desired/absolute/path/to/deepmask/ # set absolute path as desired
    git clone [email protected]:facebookresearch/deepmask.git $DEEPMASK
  2. Download the Torch ResNet-50 model pretrained on ImageNet:

    mkdir -p $DEEPMASK/pretrained; cd $DEEPMASK/pretrained
    wget https://dl.fbaipublicfiles.com/deepmask/models/resnet-50.t7
  3. Download and extract the COCO images and annotations:

    mkdir -p $DEEPMASK/data; cd $DEEPMASK/data
    wget http://msvocds.blob.core.windows.net/annotations-1-0-3/instances_train-val2014.zip
    wget http://msvocds.blob.core.windows.net/coco2014/train2014.zip
    wget http://msvocds.blob.core.windows.net/coco2014/val2014.zip

Training

To train, launch the train.lua script. It contains several options, to list them, simply use the --help flag.

  1. To train DeepMask:

    th train.lua
  2. To train SharpMask (requires pre-trained DeepMask model):

    th train.lua -dm /path/to/trained/deepmask/

Evaluation

There are two ways to evaluate a model on the COCO dataset.

  1. evalPerPatch.lua evaluates only the mask generation step. The per-patch evaluation only uses image patches that contain roughly centered objects. Its usage is as follows:

    th evalPerPatch.lua /path/to/trained/deepmask-or-sharpmask/
  2. evalPerImage.lua evaluates the full model on COCO images, as reported in the papers. By default, it evaluates performance on the first 5K COCO validation images (run th evalPerImage.lua --help to see the options):

    th evalPerImage.lua /path/to/trained/deepmask-or-sharpmask/

Precomputed Proposals

You can download pre-computed proposals (1000 per image) on the COCO and PASCAL VOC datasets, for both segmentation and bounding box proposals. We use the COCO JSON format for the proposals. The proposals are divided into chunks of 500 images each (that is, each JSON contains 1000 proposals per image for 500 images). All proposals correspond to the "zoom" setting in the paper (DeepMaskZoom and SharpMaskZoom) which tend to be most effective for object detection.

DeepMask

SharpMask

deepmask's People

Contributors

kevintpeng avatar krishmunot avatar pdollar avatar soumith avatar wanyenlo 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  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

deepmask's Issues

THCudaCheck FAIL file=/tmp/luarocks_cutorch-scm-1-4143/cutorch/lib/THC/THCGeneral.c line=20 error=38 : no CUDA-capable device is detected

Hi,

Please help me.

Please make sure you have the correct access rights
and the repository exists.
root@tong:/# git clone https://github.com/facebookresearch/deepmask.git $DEEPMASK
Cloning into '/desired/absolute/path/to/deepmask'...
remote: Counting objects: 58, done.
remote: Total 58 (delta 0), reused 0 (delta 0), pack-reused 58
Unpacking objects: 100% (58/58), done.
Checking connectivity... done.
root@tong:/# mkdir -p $DEEPMASK/pretrained/deepmask; cd $DEEPMASK/pretrained/deepmask
root@tong:/desired/absolute/path/to/deepmask/pretrained/deepmask# wget https://s3.amazonaws.com/deepmask/models/deepmask/model.t7
--2016-09-11 16:13:59-- https://s3.amazonaws.com/deepmask/models/deepmask/model.t7
Resolving s3.amazonaws.com (s3.amazonaws.com)... 54.231.115.42
Connecting to s3.amazonaws.com (s3.amazonaws.com)|54.231.115.42|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 190265914 (181M) [application/octet-stream]
Saving to: ‘model.t7’

100%[====================================================================>] 190,265,914 2.49MB/s in 2m 9s

2016-09-11 16:16:09 (1.41 MB/s) - ‘model.t7’ saved [190265914/190265914]

root@tong:/desired/absolute/path/to/deepmask/pretrained/deepmask# cd /
root@tong:/# mkdir -p $DEEPMASK/pretrained/sharpmask; cd $DEEPMASK/pretrained/sharpmask
root@tong:/desired/absolute/path/to/deepmask/pretrained/sharpmask# wget https://s3.amazonaws.com/deepmask/models/sharpmask/model.t7
--2016-09-11 16:16:52-- https://s3.amazonaws.com/deepmask/models/sharpmask/model.t7
Resolving s3.amazonaws.com (s3.amazonaws.com)... 54.231.17.96
Connecting to s3.amazonaws.com (s3.amazonaws.com)|54.231.17.96|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 212312482 (202M) [application/octet-stream]
Saving to: ‘model.t7’

40% [==============================> ] 85,677,701 106KB/s eta 12m 3100%[====================================================================>] 212,312,482 114KB/s in 26m 33s

2016-09-11 16:43:27 (130 KB/s) - ‘model.t7’ saved [212312482/212312482]

root@tong:/desired/absolute/path/to/deepmask/pretrained/sharpmask# cd $DEEPMASK
root@tong:/desired/absolute/path/to/deepmask# th computeProposals.lua $DEEPMASK/pretrained/deepmask
THCudaCheck FAIL file=/tmp/luarocks_cutorch-scm-1-4143/cutorch/lib/THC/THCGeneral.c line=20 error=38 : no CUDA-capable device is detected
/root/torch/install/bin/lua: /root/torch/install/share/lua/5.2/trepl/init.lua:384: cuda runtime error (38) : no CUDA-capable device is detected at /tmp/luarocks_cutorch-scm-1-4143/cutorch/lib/THC/THCGeneral.c:20
stack traceback:
[C]: in function 'error'
/root/torch/install/share/lua/5.2/trepl/init.lua:384: in function 'require'
computeProposals.lua:11: in main chunk
[C]: in function 'dofile'
/root/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
[C]: in ?
root@tong:/desired/absolute/path/to/deepmask# th computeProposals.lua $DEEPMASK/pretrained/sharpmask
THCudaCheck FAIL file=/tmp/luarocks_cutorch-scm-1-4143/cutorch/lib/THC/THCGeneral.c line=20 error=38 : no CUDA-capable device is detected
/root/torch/install/bin/lua: /root/torch/install/share/lua/5.2/trepl/init.lua:384: cuda runtime error (38) : no CUDA-capable device is detected at /tmp/luarocks_cutorch-scm-1-4143/cutorch/lib/THC/THCGeneral.c:20
stack traceback:
[C]: in function 'error'
/root/torch/install/share/lua/5.2/trepl/init.lua:384: in function 'require'
computeProposals.lua:11: in main chunk
[C]: in function 'dofile'
/root/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
[C]: in ?

Thank you in advance.
mrtortong

loop or previous error loading module 'tds'

when I ran th train.lua ,
I got the error :

FATAL THREAD PANIC: (pcall) not enough memory , 

so I reinstalled the lua 5.1 ,which doesn't have the same memory limitation (I saw in the issue #80) , the problem solved.
and I got another error:

convert: data//annotations/instances_train2014.json --> .t7 [please be patient]
convert: data//annotations/instances_train2014.json --> .t7 [please be patient]
converting: categories
converting: categories
converting: annotations
converting: annotations
converting: images
converting: images
convert: building indices
convert: building indices
convert: complete [46.12 s]convert: complete [46.17 s]
DataSampler.lua:12: loop or previous error loading module 'tds'

I do not know where has already required the package 'tds'.
I removed the DataSampler.lua:12 local tds = require 'tds'
another occured:

DataSampler.lua:67: attempt to index global 'tds' (a nil value)

Can you help me ?
thank you!

wrong number of arguments for function call

When I ran "th computeProposals.lua $DEEPMASK/pretrained/deepmask", I got the following error information. Do you have any idea about this problem?

/data00/liyitan/torch/install/share/lua/5.1/nn/THNN.lua:109: wrong number of arguments for function call
stack traceback:
[C]: in function 'v'
/data00/liyitan/torch/install/share/lua/5.1/nn/THNN.lua:109: in function 'SpatialMaxPooling_updateOutput'
...tan/torch/install/share/lua/5.1/nn/SpatialMaxPooling.lua:42: in function <...tan/torch/install/share/lua/5.1/nn/SpatialMaxPooling.lua:31>
[C]: in function 'xpcall'
...a00/liyitan/torch/install/share/lua/5.1/nn/Container.lua:63: in function 'rethrowErrors'
...00/liyitan/torch/install/share/lua/5.1/nn/Sequential.lua:44: in function 'forward'
/data00/liyitan/repos/deepmask/InferDeepMask.lua:100: in function 'forward'
computeProposals.lua:81: in main chunk
[C]: in function 'dofile'
...itan/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
[C]: at 0x00405d70

WARNING: If you see a stack trace below, it doesn't point to the place where this error occurred. Please use only the one above.
stack traceback:
[C]: in function 'error'
...a00/liyitan/torch/install/share/lua/5.1/nn/Container.lua:67: in function 'rethrowErrors'
...00/liyitan/torch/install/share/lua/5.1/nn/Sequential.lua:44: in function 'forward'
/data00/liyitan/repos/deepmask/InferDeepMask.lua:100: in function 'forward'
computeProposals.lua:81: in main chunk
[C]: in function 'dofile'
...itan/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
[C]: at 0x00405d70

Refine existing mask with SharpMask?

Is there a way to refine an existing mask got from elsewhere (say, I have an RGB image file and another 1-channel image file - a mask for the first image) with SharpMask?
If yes, would you give an example code snippet to achieve this?

Out of Memory for testImage.jpg

I just finished installing deepmask and all its dependencies. and as I am trying to test deep mask with:

th /home/ubuntu/gits/deepmask/computeProposals.lua /home/ubuntu/gits/deepmask/pretrained/deepmask

I get the following out of memory error:

THCudaCheck FAIL file=/tmp/luarocks_cutorch-scm-1-4253/cutorch/lib/THC/generic/THCStorage.cu line=40 error=2 : out of memory
/home/ubuntu/torch/install/bin/luajit: /home/ubuntu/torch/install/share/lua/5.1/nn/Container.lua:67:
In 5 module of nn.Sequential:
In 3 module of nn.Sequential:
In 1 module of nn.Sequential:
In 1 module of nn.ConcatTable:
In 7 module of nn.Sequential:
...torch/install/share/lua/5.1/cudnn/SpatialConvolution.lua:139: cuda runtime error (2) : out of memory at /tmp/luarocks_cutorch-scm-1-4253/cutorch/lib/THC/generic/THCStorage.cu:40
stack traceback:
        [C]: in function 'resize'
        ...torch/install/share/lua/5.1/cudnn/SpatialConvolution.lua:139: in function 'createIODescriptors'
        ...torch/install/share/lua/5.1/cudnn/SpatialConvolution.lua:366: in function <...torch/install/share/lua/5.1/cudnn/SpatialConvolution.lua:363>
        [C]: in function 'xpcall'
        /home/ubuntu/torch/install/share/lua/5.1/nn/Container.lua:63: in function 'rethrowErrors'
        /home/ubuntu/torch/install/share/lua/5.1/nn/Sequential.lua:44: in function </home/ubuntu/torch/install/share/lua/5.1/nn/Sequential.lua:41>
        [C]: in function 'xpcall'
        /home/ubuntu/torch/install/share/lua/5.1/nn/Container.lua:63: in function 'rethrowErrors'
        /home/ubuntu/torch/install/share/lua/5.1/nn/ConcatTable.lua:11: in function </home/ubuntu/torch/install/share/lua/5.1/nn/ConcatTable.lua:9>
        [C]: in function 'xpcall'
        ...
        /home/ubuntu/torch/install/share/lua/5.1/nn/Container.lua:63: in function 'rethrowErrors'
        /home/ubuntu/torch/install/share/lua/5.1/nn/Sequential.lua:44: in function </home/ubuntu/torch/install/share/lua/5.1/nn/Sequential.lua:41>
        [C]: in function 'xpcall'
        /home/ubuntu/torch/install/share/lua/5.1/nn/Container.lua:63: in function 'rethrowErrors'
        /home/ubuntu/torch/install/share/lua/5.1/nn/Sequential.lua:44: in function 'forward'
        /home/ubuntu/gits/deepmask/InferDeepMask.lua:100: in function 'forward'
        /home/ubuntu/gits/deepmask/computeProposals.lua:81: in main chunk
        [C]: in function 'dofile'
        ...untu/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
        [C]: at 0x00406670

WARNING: If you see a stack trace below, it doesn't point to the place where this error occurred. Please use only the one above.
stack traceback:
        [C]: in function 'error'
        /home/ubuntu/torch/install/share/lua/5.1/nn/Container.lua:67: in function 'rethrowErrors'
        /home/ubuntu/torch/install/share/lua/5.1/nn/Sequential.lua:44: in function 'forward'
        /home/ubuntu/gits/deepmask/InferDeepMask.lua:100: in function 'forward'
        /home/ubuntu/gits/deepmask/computeProposals.lua:81: in main chunk
        [C]: in function 'dofile'
        ...untu/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
        [C]: at 0x00406670

I am running on Amazon EC2 with an g2.8xlarge instance. Cuda 7.5 and cuDNN 5.1 are installed.

And this is the nvidi-smi output:

Tue Sep 20 13:58:01 2016

+------------------------------------------------------+
| NVIDIA-SMI 352.68     Driver Version: 352.68         |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GRID K520           Off  | 0000:00:03.0     Off |                  N/A |
| N/A   47C    P0    44W / 125W |    111MiB /  4095MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
|   1  GRID K520           Off  | 0000:00:04.0     Off |                  N/A |
| N/A   34C    P8    17W / 125W |     11MiB /  4095MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
|   2  GRID K520           Off  | 0000:00:05.0     Off |                  N/A |
| N/A   36C    P8    17W / 125W |     11MiB /  4095MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
|   3  GRID K520           Off  | 0000:00:06.0     Off |                  N/A |
| N/A   33C    P8    17W / 125W |     11MiB /  4095MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID  Type  Process name                               Usage      |
|=============================================================================|
|    0      2363    C   /home/ubuntu/torch/install/bin/luajit           50MiB |
|    0      2393    C   /home/ubuntu/torch/install/bin/luajit           47MiB |
+-----------------------------------------------------------------------------+

How much GPU memory is needed for this thing to run? as I said, I am only trying the test image that was provided so not sure how that would work for larger images.

Can not run on ubuntu 14.04 with cuda 7.5 and Titan X GPU

I am new in Luajit and torch
So, I followed the instructions to install both of them.
Then, downloaded the models for the deepmask and sharp mask and ran the command:

th computeProposals.lua /home/cvip/deepmask/pretrained/deepmask

But I received the following error. I tried to remove and reinstall everything again but nothing changed!

| loading model file... /home/cvip/deepmask/pretrained/deepmask
| start
/home/cvip/torch/install/bin/luajit: /home/cvip/torch/install/share/lua/5.1/nn/Container.lua:67:
In 4 module of nn.Sequential:
/home/cvip/torch/install/share/lua/5.1/nn/THNN.lua:109: wrong number of arguments for function call
stack traceback:
[C]: in function 'v'
/home/cvip/torch/install/share/lua/5.1/nn/THNN.lua:109: in function 'SpatialMaxPooling_updateOutput'
...vip/torch/install/share/lua/5.1/nn/SpatialMaxPooling.lua:42: in function <...vip/torch/install/share/lua/5.1/nn/SpatialMaxPooling.lua:31>
[C]: in function 'xpcall'
/home/cvip/torch/install/share/lua/5.1/nn/Container.lua:63: in function 'rethrowErrors'
/home/cvip/torch/install/share/lua/5.1/nn/Sequential.lua:44: in function 'forward'
/home/cvip/deepmask/InferDeepMask.lua:100: in function 'forward'
computeProposals.lua:81: in main chunk
[C]: in function 'dofile'
...cvip/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
[C]: at 0x00406670

WARNING: If you see a stack trace below, it doesn't point to the place where this error occurred. Please use only the one above.
stack traceback:
[C]: in function 'error'
/home/cvip/torch/install/share/lua/5.1/nn/Container.lua:67: in function 'rethrowErrors'
/home/cvip/torch/install/share/lua/5.1/nn/Sequential.lua:44: in function 'forward'
/home/cvip/deepmask/InferDeepMask.lua:100: in function 'forward'
computeProposals.lua:81: in main chunk
[C]: in function 'dofile'
...cvip/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
[C]: at 0x00406670

Crashing on g2.2xlarge?

After installing all the dependencies on a g2.2x.large, it seems to be doing nothing while running

th computeProposals.lua $DEEPMASK/pretrained/deepmask

Here's the install procedure. Not sure if i'm missing something?

mkdir download

# CUDA Toolkit
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64/cuda-repo-ubuntu1404_7.5-18_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1404_7.5-18_amd64.deb
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install -y opencl-headers build-essential protobuf-compiler \
    libprotoc-dev libboost-all-dev libleveldb-dev hdf5-tools libhdf5-serial-dev \
    libopencv-core-dev  libopencv-highgui-dev libsnappy-dev libsnappy1 \
    libatlas-base-dev cmake libstdc++6-4.8-dbg libgoogle-glog0 libgoogle-glog-dev \
    libgflags-dev liblmdb-dev git python-pip gfortran
sudo apt-get clean
sudo apt-get install -y linux-image-extra-`uname -r` linux-headers-`uname -r` linux-image-`uname -r`
sudo apt-get install -y cuda
sudo apt-get clean

vim ~/.bashrc
export CUDA_HOME=/usr/local/cuda-7.5
export LD_LIBRARY_PATH=${CUDA_HOME}/lib64:$LD_LIBRARY_PATH
export PATH=${CUDA_HOME}/bin:${PATH}
source ~/.bashrc

#download from cudnn and scp
tar -zxf cudnn-7.5-linux-x64-v5.0-ga.tgz
cd cuda
sudo cp lib64/* /usr/local/cuda/lib64/
sudo cp include/* /usr/local/cuda/include/

# TORCH & DEPS
sudo apt-get install git
git clone https://github.com/torch/distro.git ~/torch --recursive
cd ~/torch; bash install-deps;
./install.sh
source ~/.bashrc

cd ~/download
git clone https://github.com/pdollar/coco.git
cd coco
luarocks make LuaAPI/rocks/coco-scm-1.rockspec

luarocks install image
luarocks install tds

cd ~/download
git clone https://github.com/mpx/lua-cjson.git
cd lua-cjson
luarocks make

luarocks install nnx
luarocks install optim
luarocks install cutorch
luarocks install cunn
luarocks install cudnn

#DEEPMASK
cd ~
git clone https://github.com/facebookresearch/deepmask.git
cd deepmask/

DEEPMASK=/home/ubuntu/deepmask

mkdir -p $DEEPMASK/pretrained/deepmask; cd $DEEPMASK/pretrained/deepmask
wget https://s3.amazonaws.com/deepmask/models/deepmask/model.t7
mkdir -p $DEEPMASK/pretrained/sharpmask; cd $DEEPMASK/pretrained/sharpmask
wget https://s3.amazonaws.com/deepmask/models/sharpmask/model.t7

cd $DEEPMASK

th computeProposals.lua $DEEPMASK/pretrained/deepmask

when training coco dataset, meet not enough memory

Training DeepMask Model
-- ignore option rundir
-- ignore option dm
-- ignore option reload
-- ignore option gpu
-- ignore option datadir
| running in directory /home/gavinpan/workspace/deepmask/exps/deepmask/exp
| number of paramaters trunk: 15198016
| number of paramaters mask branch: 1608768
| number of paramaters score branch: 526337
| number of paramaters total: 17333121
convert: data//annotations/instances_train2014.json --> .t7 [please be patient]
convert: data//annotations/instances_train2014.json --> .t7 [please be patient]
FATAL THREAD PANIC: (pcall) not enough memory
/home/gavinpan/torch/install/bin/luajit: ...gavinpan/torch/install/share/lua/5.1/threads/threads.lua:183: [thread 2 callback] not enough memory
stack traceback:
[C]: in function 'error'
...gavinpan/torch/install/share/lua/5.1/threads/threads.lua:183: in function 'dojob'
...gavinpan/torch/install/share/lua/5.1/threads/threads.lua:264: in function 'synchronize'
...gavinpan/torch/install/share/lua/5.1/threads/threads.lua:142: in function 'specific'
...gavinpan/torch/install/share/lua/5.1/threads/threads.lua:125: in function 'Threads'
/home/gavinpan/workspace/deepmask/DataLoader.lua:40: in function '__init'
/home/gavinpan/torch/install/share/lua/5.1/torch/init.lua:91: in function </home/gavinpan/torch/install/share/lua/5.1/torch/init.lua:87>
[C]: in function 'DataLoader'
/home/gavinpan/workspace/deepmask/DataLoader.lua:21: in function 'create'
train.lua:125: in main chunk
[C]: in function 'dofile'
...npan/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
[C]: at 0x00405ea0

Invalid JSON file with precomputed proposals of SharpMask on COCO testfull

When I process the file downloaded from https://s3.amazonaws.com/deepmask/boxes/sharpmask-coco-test-full-bbox.tar.gz I get this error:

deep32:deepmask/⇒  python prune_objects_3.py sharpmaskZoom_bbox_coco_testfull.json 0.91
Reading file...
Traceback (most recent call last):
  File "prune_objects_3.py", line 6, in <module>
    data = json.load(f)
  File "/usr/lib/python2.7/json/__init__.py", line 290, in load
    **kw)
  File "/usr/lib/python2.7/json/__init__.py", line 338, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 366, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python2.7/json/decoder.py", line 382, in raw_decode
    obj, end = self.scan_once(s, idx)
ValueError: Unterminated string starting at: line 1 column 6312834042 (char 6312834041)

train.lua error

I want to konw how to train model with my own images. And when I run th train.lua, I met the error below:
C]: in function 'error'
...wang/torch/install/share/lua/5.1/threads/threads.lua:183: in function 'dojob'
...wang/torch/install/share/lua/5.1/threads/threads.lua:264: in function 'synchronize'
...wang/torch/install/share/lua/5.1/threads/threads.lua:142: in function 'specific'
...wang/torch/install/share/lua/5.1/threads/threads.lua:125: in function 'Threads'
/home/wang/Documents/deepmask/DataLoader.lua:40: in function '__init'
/home/wang/torch/install/share/lua/5.1/torch/init.lua:91: in function
[C]: in function 'DataLoader'
/home/wang/Documents/deepmask/DataLoader.lua:21: in function 'create'
train.lua:101: in main chunk
[C]: in function 'dofile'
...wang/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
[C]: at 0x00405d50

No rights to access deepmask git repo

Hi Deep guys:

I 'am cloning deepmask git repo by using this command:

git clone [email protected]:facebookresearch/deepmask.gi

But I met access right problem when it started as beblow:

warning: Permanently added the RSA host key for IP address '192.30.253.113' to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Does any one know how to handle this?
Thank you !

Run on CPU

My macbook doesn't have an nvidia gpu. Is there a way to run the pretrained models on the cpu, without CUDA?

Failed run DeepMask

I faced with a lot of errors but install all packages. And finaly then I try do - th computeProposals.lua $DEEPMASK/pretrained/deepmask - I see this error

alexander@alexander-X550MJ:~/deepmask-master$ th computeProposals.lua $DEEPMASK/pretrained/deepmask
| loading model file... /home/alexander/deepmask-master/pretrained/deepmask
Warning: Failed to load function from bytecode: binary string: bad header in precompiled chunkWarning: Failed to load function from bytecode: [string ""]:1: unexpected symbol near 'char(5)'/home/alexander/torch/install/bin/lua: ...ome/alexander/.luarocks/share/lua/5.1/torch/File.lua:375: unknown object
stack traceback:
[C]: in function 'error'
...ome/alexander/.luarocks/share/lua/5.1/torch/File.lua:375: in function 'readObject'
...ome/alexander/.luarocks/share/lua/5.1/torch/File.lua:307: in function 'readObject'
...ome/alexander/.luarocks/share/lua/5.1/torch/File.lua:369: in function 'readObject'
...home/alexander/.luarocks/share/lua/5.1/nn/Module.lua:158: in function 'read'
...ome/alexander/.luarocks/share/lua/5.1/torch/File.lua:351: in function 'readObject'
...ome/alexander/.luarocks/share/lua/5.1/torch/File.lua:369: in function 'readObject'
...ome/alexander/.luarocks/share/lua/5.1/torch/File.lua:369: in function 'readObject'
...home/alexander/.luarocks/share/lua/5.1/nn/Module.lua:158: in function 'read'
...ome/alexander/.luarocks/share/lua/5.1/torch/File.lua:351: in function 'readObject'
...ome/alexander/.luarocks/share/lua/5.1/torch/File.lua:369: in function 'readObject'
...home/alexander/.luarocks/share/lua/5.1/nn/Module.lua:158: in function 'read'
...ome/alexander/.luarocks/share/lua/5.1/torch/File.lua:351: in function 'readObject'
...ome/alexander/.luarocks/share/lua/5.1/torch/File.lua:369: in function 'readObject'
...ome/alexander/.luarocks/share/lua/5.1/torch/File.lua:409: in function 'load'
computeProposals.lua:48: in main chunk
[C]: in function 'dofile'
.../torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
[C]: ?

Help, I losing courage ):

Out of memory when "Training your own model" with COCO data set.

When I run command "th train.lua" I got below error

| number of paramaters trunk: 15198016
| number of paramaters mask branch: 1608768
| number of paramaters score branch: 526337
| number of paramaters total: 17333121
convert: data//annotations/instances_train2014.json --> .t7 [please be patient]
convert: data//annotations/instances_train2014.json --> .t7 [please be patient]
/home/ai02/torch/install/bin/luajit: /home/ai02/torch/install/share/lua/5.1/threads/threads.lua:184: [thread 1 callback] not enough memory
stack traceback:
[C]: in function 'error'
/home/ai02/torch/install/share/lua/5.1/threads/threads.lua:184: in function 'dojob'
/home/ai02/torch/install/share/lua/5.1/threads/threads.lua:265: in function 'synchronize'
/home/ai02/torch/install/share/lua/5.1/threads/threads.lua:142: in function 'specific'
/home/ai02/torch/install/share/lua/5.1/threads/threads.lua:125: in function 'Threads'
...-86a8-25a46f4534ea/projects/fbai/deepmask/DataLoader.lua:40: in function '__init'
/home/ai02/torch/install/share/lua/5.1/torch/init.lua:91: in function </home/ai02/torch/install/share/lua/5.1/torch/init.lua:87>
[C]: in function 'DataLoader'
...-86a8-25a46f4534ea/projects/fbai/deepmask/DataLoader.lua:21: in function 'create'
train.lua:101: in main chunk
[C]: in function 'dofile'
...ai02/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
[C]: at 0x00406670

I had tried to trace back the error tree and find out that the "callstatus" value is "false" in function "dojob" line 169 at file "torch/install/share/lua/5.1/threads/threads.lua"

local callstatus, args, endcallbackid, threadid = self.mainqueue:dojob()

I cant find how to pass this error. I had tested with lower batch, maxload, testmaxload and maxexpoch but did not success.

My computer properties are:
RAM: 32Gb
Processor: Intel Core i7-4790K CPU @ 4.0GHz x 8
Graphics: GeForce GTX TITAN X/PCIe/SSE2
Free disk space: 230 Gb

Training my own model - loaded the train data twice

Execute
$ th train.lua

Will generate the following console output:

-- ignore option rundir
-- ignore option dm
-- ignore option reload
-- ignore option gpu
-- ignore option datadir
| running in directory $DEEPMASK/exps/deepmask/exp
| number of paramaters trunk: 15198016
| number of paramaters mask branch: 1608768
| number of paramaters score branch: 526337
| number of paramaters total: 17333121
convert: data//annotations/instances_train2014.json --> .t7 [please be patient]
convert: data//annotations/instances_train2014.json --> .t7 [please be patient]

We try to load the train annotations twice, while we should have load the val on the second attempt.

p.s.
Thanks for releasing this. Amazing work.

Can't run training

I'm trying to follow Training Your Own Model paragraph and get:

[kontiki@sanctum deepmask (master ✗)]$ th train.lua -datadir data (master|…)
-- ignore option rundir
-- ignore option dm
-- ignore option reload
-- ignore option gpu
-- ignore option datadir
| running in directory /media/3tb/data/downloads/nix/lab/deepmask/exps/deepmask/exp
| number of paramaters trunk: 15198016
| number of paramaters mask branch: 1608768
| number of paramaters score branch: 526337
| number of paramaters total: 17333121
/opt/torch/install/bin/luajit: /opt/torch/install/share/lua/5.1/threads/threads.lua:183: [thread 2 callback] /opt/torch/install/share/lua/5.1/coco/CocoApi.lua:126: assertion failed!
stack traceback:
[C]: in function 'assert'
/opt/torch/install/share/lua/5.1/coco/CocoApi.lua:126: in function '__init'
/opt/torch/install/share/lua/5.1/torch/init.lua:91: in function </opt/torch/install/share/lua/5.1/torch/init.lua:87>
[C]: in function 'CocoApi'
/media/3tb/data/downloads/nix/lab/deepmask/DataSampler.lua:25: in function '__init'
/opt/torch/install/share/lua/5.1/torch/init.lua:91: in function </opt/torch/install/share/lua/5.1/torch/init.lua:87>
[C]: in function 'DataSampler'
/media/3tb/data/downloads/nix/lab/deepmask/DataLoader.lua:36: in function </media/3tb/data/downloads/nix/lab/deepmask/DataLoader.lua:30>
[C]: in function 'xpcall'
/opt/torch/install/share/lua/5.1/threads/threads.lua:234: in function 'callback'
/opt/torch/install/share/lua/5.1/threads/queue.lua:65: in function </opt/torch/install/share/lua/5.1/threads/queue.lua:41>
[C]: in function 'pcall'
/opt/torch/install/share/lua/5.1/threads/queue.lua:40: in function 'dojob'
[string " local Queue = require 'threads.queue'..."]:13: in main chunk
stack traceback:
[C]: in function 'error'
/opt/torch/install/share/lua/5.1/threads/threads.lua:183: in function 'dojob'
/opt/torch/install/share/lua/5.1/threads/threads.lua:264: in function 'synchronize'
/opt/torch/install/share/lua/5.1/threads/threads.lua:142: in function 'specific'
/opt/torch/install/share/lua/5.1/threads/threads.lua:125: in function 'Threads'
/media/3tb/data/downloads/nix/lab/deepmask/DataLoader.lua:40: in function '__init'
/opt/torch/install/share/lua/5.1/torch/init.lua:91: in function </opt/torch/install/share/lua/5.1/torch/init.lua:87>
[C]: in function 'DataLoader'
/media/3tb/data/downloads/nix/lab/deepmask/DataLoader.lua:21: in function 'create'
train.lua:101: in main chunk
[C]: in function 'dofile'
/opt/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
[C]: at 0x00406670

Permission denied (publickey). fatal: Could not read from remote repository.

Hi.

root@tong:/# git clone [email protected]:facebookresearch/deepmask.git $DEEPMASK
Cloning into '/desired/absolute/path/to/deepmask'...
Warning: Permanently added the RSA host key for IP address '192.30.253.113' to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Please recommend.
mrtortong.

out of memory on trains own model with coco data

installed
torch with lua5.2
dependent lua packages
cuda 8.0 and patch for gcc 5.4 later
on g2.2xlarge

Error Occurred like below...
when monitor with top, i have enough memory..

-- ignore option gpu
-- ignore option reload
-- ignore option datadir
-- ignore option rundir
-- ignore option dm
| running in directory /home/ubuntu/deepmask/exps/deepmask/exp
| number of paramaters trunk: 15198016
| number of paramaters mask branch: 1608768
| number of paramaters score branch: 526337
| number of paramaters total: 17333121
| start training
THCudaCheck FAIL file=/home/ubuntu/torch/extra/cutorch/lib/THC/generic/THCStorage.cu line=40 error=2 : out of memory
/home/ubuntu/torch/install/bin/lua: /home/ubuntu/torch/install/share/lua/5.2/nn/Container.lua:67:
In 1 module of nn.Sequential:
In 6 module of nn.Sequential:
In 3 module of nn.Sequential:
In 2 module of nn.Sequential:
/home/ubuntu/torch/install/share/lua/5.2/nn/CAddTable.lua:27: cuda runtime error (2) : out of memory at /home/ubuntu/torch/extra/cutorch/lib/THC/generic/THCStorage.cu:40
stack traceback:
[C]: in function 'resizeAs'
/home/ubuntu/torch/install/share/lua/5.2/nn/CAddTable.lua:27: in function 'updateGradInput'
/home/ubuntu/torch/install/share/lua/5.2/nn/Module.lua:31: in function </home/ubuntu/torch/install/share/lua/5.2/nn/Module.lua:29>
[C]: in function 'xpcall'
/home/ubuntu/torch/install/share/lua/5.2/nn/Container.lua:63: in function 'rethrowErrors'
/home/ubuntu/torch/install/share/lua/5.2/nn/Sequential.lua:84: in function </home/ubuntu/torch/install/share/lua/5.2/nn/Sequential.lua:78>
[C]: in function 'xpcall'
/home/ubuntu/torch/install/share/lua/5.2/nn/Container.lua:63: in function 'rethrowErrors'
/home/ubuntu/torch/install/share/lua/5.2/nn/Sequential.lua:84: in function </home/ubuntu/torch/install/share/lua/5.2/nn/Sequential.lua:78>
[C]: in function 'xpcall'
/home/ubuntu/torch/install/share/lua/5.2/nn/Container.lua:63: in function 'rethrowErrors'
/home/ubuntu/torch/install/share/lua/5.2/nn/Sequential.lua:84: in function </home/ubuntu/torch/install/share/lua/5.2/nn/Sequential.lua:78>
[C]: in function 'xpcall'
/home/ubuntu/torch/install/share/lua/5.2/nn/Container.lua:63: in function 'rethrowErrors'
/home/ubuntu/torch/install/share/lua/5.2/nn/Sequential.lua:88: in function 'backward'
/home/ubuntu/deepmask/TrainerDeepMask.lua:88: in function 'train'
train.lua:117: in main chunk
[C]: in function 'dofile'
...untu/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
[C]: in ?

WARNING: If you see a stack trace below, it doesn't point to the place where this error occurred. Please use only the one above.
stack traceback:
[C]: in function 'error'
/home/ubuntu/torch/install/share/lua/5.2/nn/Container.lua:67: in function 'rethrowErrors'
/home/ubuntu/torch/install/share/lua/5.2/nn/Sequential.lua:88: in function 'backward'
/home/ubuntu/deepmask/TrainerDeepMask.lua:88: in function 'train'
train.lua:117: in main chunk
[C]: in function 'dofile'
...untu/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
[C]: in ?

unable to download sharpmask/model.t7


deepmask/model.t7
 downloads fine but I get a 403 when I try to download sharpmask/model.t7


$ wget https://s3.amazonaws.com/deepmask/models/sharpmask/model.t7

--2016-08-28 14:55:47--  https://s3.amazonaws.com/deepmask/models/sharpmask/model.t7%E2%80%A8
Resolving s3.amazonaws.com... 54.231.72.210
Connecting to s3.amazonaws.com|54.231.72.210|:443... connected.
HTTP request sent, awaiting response... 403 Forbidden
2016-08-28 14:55:49 ERROR 403: Forbidden.

Error when training in COCO datasets with"th train.lua"

When I run the command without any changes following the tutorial :

~/Documents/deepmask$ th train.lua

then, it goes:
-- ignore option rundir
-- ignore option dm
-- ignore option reload
-- ignore option gpu
-- ignore option datadir
| running in directory /home/w00378682/Documents/deepmask/exps/deepmask/exp
| number of paramaters trunk: 15198016
| number of paramaters mask branch: 1608768
| number of paramaters score branch: 526337
| number of paramaters total: 17333121
convert: data//annotations/instances_train2014.json --> .t7 [please be patient]
convert: data//annotations/instances_train2014.json --> .t7 [please be patient]
FATAL THREAD PANIC: (pcall) not enough memory
/home/wang/torch/install/bin/luajit: ...wang/torch/install/share/lua/5.1/threads/threads.lua:183: [thread 2 callback] not enough memory
stack traceback:
[C]: in function 'error'
...wang/torch/install/share/lua/5.1/threads/threads.lua:183: in function 'dojob'
...wang/torch/install/share/lua/5.1/threads/threads.lua:264: in function 'synchronize'
...wang/torch/install/share/lua/5.1/threads/threads.lua:142: in function 'specific'
...wang/torch/install/share/lua/5.1/threads/threads.lua:125: in function 'Threads'
/home/wang/Documents/deepmask/DataLoader.lua:40: in function '__init'
/home/wang/torch/install/share/lua/5.1/torch/init.lua:91: in function </home/wang/torch/install/share/lua/5.1/torch/init.lua:87>
[C]: in function 'DataLoader'
/home/wang/Documents/deepmask/DataLoader.lua:21: in function 'create'
train.lua:101: in main chunk
[C]: in function 'dofile'
...wang/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
[C]: at 0x00405d50

Can somebody help me with this issue? I have configured deepmask with Ubuntu16.04 and GTX1080, cuda8.0 and 32GB memory. Thanks sooooo much.

error when run th train.lua

-- ignore option rundir
-- ignore option dm
-- ignore option reload
-- ignore option gpu
-- ignore option datadir
| running in directory /home/tong/Downloads/deepmask-master/exps/deepmask/exp
| number of paramaters trunk: 15213312
| number of paramaters mask branch: 1608768
| number of paramaters score branch: 526337
| number of paramaters total: 17348417
| start training
/home/tong/torch/install/bin/luajit: /home/tong/torch/install/share/lua/5.1/threads/threads.lua:183: [thread 2 callback] bad argument #2 to '?' (out of range at /home/tong/torch/pkg/torch/generic/Tensor.c:890)
stack traceback:
[C]: at 0x7f8621d976b0
[C]: in function '__index'
/home/tong/Downloads/deepmask-master/DataSampler.lua:135: in function 'maskSampling'
/home/tong/Downloads/deepmask-master/DataSampler.lua:111: in function 'get'
/home/tong/Downloads/deepmask-master/DataLoader.lua:70: in function </home/tong/Downloads/deepmask-master/DataLoader.lua:64>
[C]: in function 'xpcall'
/home/tong/torch/install/share/lua/5.1/threads/threads.lua:234: in function 'callback'
/home/tong/torch/install/share/lua/5.1/threads/queue.lua:65: in function </home/tong/torch/install/share/lua/5.1/threads/queue.lua:41>
[C]: in function 'pcall'
/home/tong/torch/install/share/lua/5.1/threads/queue.lua:40: in function 'dojob'
[string " local Queue = require 'threads.queue'..."]:15: in main chunk
stack traceback:
[C]: in function 'error'
/home/tong/torch/install/share/lua/5.1/threads/threads.lua:183: in function 'dojob'
/home/tong/Downloads/deepmask-master/DataLoader.lua:95: in function '(for generator)'
/home/tong/Downloads/deepmask-master/TrainerDeepMask.lua:68: in function 'train'
train.lua:117: in main chunk
[C]: in function 'dofile'
...tong/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
[C]: at 0x00405d50

can anyone tell me how to fix it...

Invalid Arguments

I just installed deepmask with cuda 7.5 and cudnn 5 and all other torch dependencies and everything went quite well with no errors.

I downloaded the pretrained models as the Quick start guide suggested but when I try and run computeProposals.lua I get this error:

th computeProposals.lua ./pretrained/sharpmask/ -img ~/images/cow-1287866_1920.jpg

| loading model file... ./pretrained/sharpmask/
/home/ubuntu/torch/install/bin/luajit: [string "argcheck"]:264:
Arguments:

   self    = Infer         --
  [np      = number]       --  [default=500]
   scales  = table         --
   meanstd = table         --
   model   = nn.Container  --
  [iSz     = number]       --  [default=160]
  [dm      = boolean]      --  [default=false]
  [timer   = boolean]      --  [default=false]

invalid arguments!
stack traceback:
        [C]: in function 'error'
        [string "argcheck"]:264: in function '__init'
        /home/ubuntu/torch/install/share/lua/5.1/torch/init.lua:91: in function </home/ubuntu/torch/install/share/lua/5.1/torch/init.lua:87>
        [C]: in function 'Infer'
        computeProposals.lua:64: in main chunk
        [C]: in function 'dofile'
        ...untu/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
        [C]: at 0x00406670

Not sure what I'm missing here, what arguments should I use?

Failed to run "th train.lua" ...

I'm trying to follow Training Your Own Model paragraph and get the following messages.
And I can't find the file : /tmp/luarocks_torch-scm-1-5531/torch7/lib/TH/THDiskFile.c.
I don't know why ....

hhteng@zhsw-ws04:~/facebook/multipathnet/deepmask$ th train.lua
-- ignore option rundir
-- ignore option dm
-- ignore option reload
-- ignore option gpu
-- ignore option datadir
| running in directory /home/hhteng/facebook/multipathnet/deepmask/exps/deepmask/exp
/usr/bin/luajit: /usr/share/lua/5.1/torch/File.lua:351: read error: read 14017327 blocks instead of 25549352 at /tmp/luarocks_torch-scm-1-5531/torch7/lib/TH/THDiskFile.c:340
stack traceback:
[C]: in function 'read'
/usr/share/lua/5.1/torch/File.lua:351: in function </usr/share/lua/5.1/torch/File.lua:245>
[C]: in function 'read'
/usr/share/lua/5.1/torch/File.lua:351: in function 'readObject'
/usr/share/lua/5.1/torch/File.lua:369: in function 'readObject'
/usr/share/lua/5.1/nn/Module.lua:184: in function 'read'
/usr/share/lua/5.1/torch/File.lua:351: in function 'readObject'
/usr/share/lua/5.1/torch/File.lua:369: in function 'readObject'
/usr/share/lua/5.1/torch/File.lua:369: in function 'readObject'
/usr/share/lua/5.1/nn/Module.lua:184: in function 'read'
/usr/share/lua/5.1/torch/File.lua:351: in function 'readObject'
/usr/share/lua/5.1/torch/File.lua:409: in function 'load'
/home/hhteng/facebook/multipathnet/deepmask/DeepMask.lua:56: in function 'createTrunk'
/home/hhteng/facebook/multipathnet/deepmask/DeepMask.lua:28: in function '__init'
/usr/share/lua/5.1/torch/init.lua:91: in function </usr/share/lua/5.1/torch/init.lua:87>
[C]: in function 'DeepMask'
train.lua:95: in main chunk
[C]: in function 'dofile'
/usr/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
[C]: at 0x00406670

poor performance on large size image

Dear,

When I try to generate proposals with deepmask on large size image, such as 1280x1280, deepmask shows very poor performance. In fact, I can hardly find proposal whose Iou>0.5.

So, my question is that are there some requirements about the size of input image. I didn't find related information from the paper and internet. So I come up with this question here.

Looking forward to your reply.

got stuck when training a smaller dataset

I want to just have a try training in a smaller dataset(about 150 image files, and I also generate my own annotation json file). when running train.lua, the program got stuck in "start training". I print the running information and find it was stuck at "dojob()" in dataloader.lua where n=7. what's wrong?

Fine tuning

How to fine tune your model?
I don't have sufficient data to retrain your model from scratch.
I want to fine tune your model on my data which has only two classes ?

CUDNN_STATUS_NOT_INITIALIZED on `th computeProposals.lua`

After installing all dependencies + CuDNN 6.5, I'm seeing the following error on th computeProposals.lua $DEEPMASK/pretrained/deepmask. I have no idea how to address this. If someone has some thoughts, that would be helpful.

$ th computeProposals.lua $DEEPMASK/pretrained/deepmask # run DeepMask
Found Environment variable CUDNN_PATH = /home/ec2-user/cuda/lib64/libcudnn.so.5 
| loading model file... /home/ec2-user/deepmask/pretrained/deepmask 
| start 
/home/ec2-user/torch/install/bin/luajit: /home/ec2-user/torch/install/share/lua/5.1/nn/Container.lua:67: 
In 1 module of nn.Sequential:
In 2 module of nn.Sequential:
/home/ec2-user/torch/install/share/lua/5.1/cudnn/init.lua:105: Error in CuDNN: CUDNN_STATUS_NOT_INITIALIZED
stack traceback:
    [C]: in function 'error'
    /home/ec2-user/torch/install/share/lua/5.1/cudnn/init.lua:105: in function 'getHandle'
    /home/ec2-user/torch/install/share/lua/5.1/cudnn/init.lua:113: in function 'errcheck'
    ...torch/install/share/lua/5.1/cudnn/SpatialConvolution.lua:39: in function 'resetWeightDescriptors'
    ...torch/install/share/lua/5.1/cudnn/SpatialConvolution.lua:364: in function <...torch/install/share/lua/5.1/cudnn/SpatialConvolution.lua:363>
    [C]: in function 'xpcall'
    /home/ec2-user/torch/install/share/lua/5.1/nn/Container.lua:63: in function 'rethrowErrors'
    ...e/ec2-user/torch/install/share/lua/5.1/nn/Sequential.lua:44: in function <...e/ec2-user/torch/install/share/lua/5.1/nn/Sequential.lua:41>
    [C]: in function 'xpcall'
    /home/ec2-user/torch/install/share/lua/5.1/nn/Container.lua:63: in function 'rethrowErrors'
    ...e/ec2-user/torch/install/share/lua/5.1/nn/Sequential.lua:44: in function 'forward'
    /home/ec2-user/deepmask/InferDeepMask.lua:100: in function 'forward'
    computeProposals.lua:81: in main chunk
    [C]: in function 'dofile'
    ...user/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
    [C]: at 0x004064c0

WARNING: If you see a stack trace below, it doesn't point to the place where this error occurred. Please use only the one above.
stack traceback:
    [C]: in function 'error'
    /home/ec2-user/torch/install/share/lua/5.1/nn/Container.lua:67: in function 'rethrowErrors'
    ...e/ec2-user/torch/install/share/lua/5.1/nn/Sequential.lua:44: in function 'forward'
    /home/ec2-user/deepmask/InferDeepMask.lua:100: in function 'forward'
    computeProposals.lua:81: in main chunk
    [C]: in function 'dofile'
    ...user/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
    [C]: at 0x004064c0

no field package.preload['cutorch']

Hi

no field package.preload['cutorch']
no file '/root/.luarocks/share/lua/5.1/cutorch.lua'
no file '/root/.luarocks/share/lua/5.1/cutorch/init.lua'
no file '/root/torch/install/share/lua/5.1/cutorch.lua'
no file '/root/torch/install/share/lua/5.1/cutorch/init.lua'
no file './cutorch.lua'
no file '/root/torch/install/share/luajit-2.1.0-beta1/cutorch.lua'
no file '/usr/local/share/lua/5.1/cutorch.lua'
no file '/usr/local/share/lua/5.1/cutorch/init.lua'
no file '/root/.luarocks/lib/lua/5.1/cutorch.so'
no file '/root/torch/install/lib/lua/5.1/cutorch.so'
no file '/root/torch/install/lib/cutorch.so'
no file './cutorch.so'
no file '/usr/local/lib/lua/5.1/cutorch.so'
no file '/usr/local/lib/lua/5.1/loadall.so'

stack traceback:
[C]: in function 'error'
/root/torch/install/share/lua/5.1/trepl/init.lua:384: in function 'require'
computeProposals.lua:11: in main chunk
[C]: in function 'dofile'
/root/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
[C]: at 0x00405d50

Please recommend.
mrtortong.

Can't to install COCO API, cjson

Dear, Developer,
when I try to install deepmask and sharpmask tool,
I can't install COCO API, and cjson which need by tools,

linux@linux:~/work$ luarocks install COCO API
Error: No results matching query were found.

could you guide me how to install torch package of COCO API and cjson?

Thanks.

Error loading module tds due to 'threads.sharedserialize'

Hi,

I have installed DeepMask and have been able to run the pre-trained version on images, but cannot train it by running th train.lua . I get the following error:

andrey@regalalgorithm:~/Documents/Stanford/Project/deepmask$ th train.lua -nthreads 1
-- ignore option dm
-- ignore option datadir
nthreads 1 2
-- ignore option rundir
-- ignore option reload
-- ignore option gpu
| running in directory /home/andrey/Documents/Stanford/Project/deepmask/exps/deepmask/exp,nthreads=1
| number of paramaters trunk: 15198016
| number of paramaters mask branch: 1608768
| number of paramaters score branch: 526337
| number of paramaters total: 17333121
/home/andrey/Documents/Libs/torch/install/bin/lua: ...Libs/torch/install/share/lua/5.1/threads/threads.lua:183: [thread 1 callback] .../Documents/Stanford/Project/deepmask/DataSampler.lua:12: loop or previous error loading module 'tds'
stack traceback:
[C]: in function 'require'
.../Documents/Stanford/Project/deepmask/DataSampler.lua:12: in main chunk
[C]: in function 'dofile'
...ents/Libs/torch/install/share/lua/5.1/paths/init.lua:84: in function 'dofile'
...y/Documents/Stanford/Project/deepmask/DataLoader.lua:35: in function <...y/Documents/Stanford/Project/deepmask/DataLoader.lua:30>
(tail call): ?
[C]: in function 'xpcall'
...Libs/torch/install/share/lua/5.1/threads/threads.lua:234: in function 'callback'
...s/Libs/torch/install/share/lua/5.1/threads/queue.lua:65: in function <...s/Libs/torch/install/share/lua/5.1/threads/queue.lua:41>
[C]: in function 'pcall'
...s/Libs/torch/install/share/lua/5.1/threads/queue.lua:40: in function 'dojob'
[string " local Queue = require 'threads.queue'..."]:13: in main chunk
stack traceback:
[C]: in function 'error'
...Libs/torch/install/share/lua/5.1/threads/threads.lua:183: in function 'dojob'
...Libs/torch/install/share/lua/5.1/threads/threads.lua:264: in function 'synchronize'
...Libs/torch/install/share/lua/5.1/threads/threads.lua:142: in function 'specific'
...Libs/torch/install/share/lua/5.1/threads/threads.lua:125: in function <...Libs/torch/install/share/lua/5.1/threads/threads.lua:36>
(tail call): ?
...y/Documents/Stanford/Project/deepmask/DataLoader.lua:40: in function '__init'
...ents/Libs/torch/install/share/lua/5.1/torch/init.lua:91: in function <...ents/Libs/torch/install/share/lua/5.1/torch/init.lua:87>
[C]: in function 'DataLoader'
...y/Documents/Stanford/Project/deepmask/DataLoader.lua:21: in function 'create'
train.lua:100: in main chunk
[C]: in function 'dofile'
.../torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
[C]: ?

At first it looked very similar to #41 , but I have tds installed and can import it with no problem elsewhere. After digging a bit I realized it may have to do with the line Threads.serialization('threads.sharedserialize') , and indeed removing it causes the problem to go away, but then I get another problem

/home/andrey/Documents/Libs/torch/install/bin/lua: ...Libs/torch/install/share/lua/5.1/threads/threads.lua:183: [thread 1 callback] ...uments/Libs/torch/install/share/lua/5.1/tds/hash.lua:150: bad argument #1 to 'pairs' (table expected, got userdata)
stack traceback:
[C]: in function 'pairs'
...uments/Libs/torch/install/share/lua/5.1/tds/hash.lua:150: in function <...uments/Libs/torch/install/share/lua/5.1/tds/hash.lua:136>
[C]: ?
[C]: ?
[C]: in function 'print'
.../Documents/Stanford/Project/deepmask/DataSampler.lua:169: in function 'scoreSampling'
.../Documents/Stanford/Project/deepmask/DataSampler.lua:113: in function 'get'
...y/Documents/Stanford/Project/deepmask/DataLoader.lua:69: in function <...y/Documents/Stanford/Project/deepmask/DataLoader.lua:63>
(tail call): ?
[C]: in function 'xpcall'
...Libs/torch/install/share/lua/5.1/threads/threads.lua:234: in function 'callback'
...s/Libs/torch/install/share/lua/5.1/threads/queue.lua:65: in function <...s/Libs/torch/install/share/lua/5.1/threads/queue.lua:41>
[C]: in function 'pcall'
...s/Libs/torch/install/share/lua/5.1/threads/queue.lua:40: in function 'dojob'
[string " local Queue = require 'threads.queue'..."]:15: in main chunk
stack traceback:
[C]: in function 'error'
...Libs/torch/install/share/lua/5.1/threads/threads.lua:183: in function 'dojob'
...y/Documents/Stanford/Project/deepmask/DataLoader.lua:94: in function '(for generator)'
...uments/Stanford/Project/deepmask/TrainerDeepMask.lua:68: in function 'train'
train.lua:116: in main chunk
[C]: in function 'dofile'
.../torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
[C]: ?

Have not been able to get a clue as to why this is happening... would appreciate help.

SharpMask Without Normalization?

Hi, thx for your excellent work! When I run the sharpmask code I find you have not performed normalization before feature concatenation. I wonder whether it will perform better if adding normalization between different layers' features.

THNN.lua:109: wrong number of arguments for function

$ th computeProposals.lua pretrained/deepmask

gives me this error

| loading model file... ../pretrained/deepmask
| start
/home/ubuntu/torch/install/bin/luajit: /home/ubuntu/torch/install/share/lua/5.1/nn/Container.lua:67:
In 4 module of nn.Sequential:
/home/ubuntu/torch/install/share/lua/5.1/nn/THNN.lua:109: wrong number of arguments for function call
stack traceback:
    [C]: in function 'v'
    /home/ubuntu/torch/install/share/lua/5.1/nn/THNN.lua:109: in function 'SpatialMaxPooling_updateOutput'
    ...ntu/torch/install/share/lua/5.1/nn/SpatialMaxPooling.lua:42: in function <...ntu/torch/install/share/lua/5.1/nn/SpatialMaxPooling.lua:31>
    [C]: in function 'xpcall'
    /home/ubuntu/torch/install/share/lua/5.1/nn/Container.lua:63: in function 'rethrowErrors'
    /home/ubuntu/torch/install/share/lua/5.1/nn/Sequential.lua:44: in function 'forward'
    /home/ubuntu/deepmask/deepmask/InferDeepMask.lua:100: in function 'forward'
    computeProposals.lua:81: in main chunk
    [C]: in function 'dofile'
    ...untu/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
    [C]: at 0x00406670

WARNING: If you see a stack trace below, it doesn't point to the place where this error occurred. Please use only the one above.
stack traceback:
    [C]: in function 'error'
    /home/ubuntu/torch/install/share/lua/5.1/nn/Container.lua:67: in function 'rethrowErrors'
    /home/ubuntu/torch/install/share/lua/5.1/nn/Sequential.lua:44: in function 'forward'
    /home/ubuntu/deepmask/deepmask/InferDeepMask.lua:100: in function 'forward'
    computeProposals.lua:81: in main chunk
    [C]: in function 'dofile'
    ...untu/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
    [C]: at 0x00406670

computeProposals and evalPerPatch functional, but training fails

Hello,

I've installed dependencies and deepmask as per the README instructions, and have be able to successfully run computeProposals on an image, as well as use evalPerPatch to evaluate the pretrained networks on the COCO dataset. The difficulty that I encounter is that when attempting to run training, I receive the following error:

root@735ebbd730d6:~/deepmask-repo# th train.lua
-- ignore option rundir 
-- ignore option dm 
-- ignore option reload 
-- ignore option gpu    
-- ignore option datadir    
| running in directory /root/deepmask-repo/exps/deepmask/exp    
/root/torch/install/bin/luajit: /root/torch/install/share/lua/5.1/inn/utils.lua:72: assertion failed!
stack traceback:
    [C]: in function 'assert'
    /root/torch/install/share/lua/5.1/inn/utils.lua:72: in function 'callback'
    /root/torch/install/share/lua/5.1/nn/Module.lua:388: in function 'replace'
    /root/torch/install/share/lua/5.1/nn/Module.lua:391: in function 'replace'
    /root/torch/install/share/lua/5.1/inn/utils.lua:68: in function 'BNtoFixed'
    /root/deepmask-repo/DeepMask.lua:59: in function 'createTrunk'
    /root/deepmask-repo/DeepMask.lua:28: in function '__init'
    /root/torch/install/share/lua/5.1/torch/init.lua:91: in function </root/torch/install/share/lua/5.1/torch/init.lua:87>
    [C]: in function 'DeepMask'
    train.lua:95: in main chunk
    [C]: in function 'dofile'
    /root/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
    [C]: at 0x00406670

In an effort to understand why this might be occurring I found the failing assertion in /root/torch/install/share/lua/5.1/inn/utils.lua on line 72. A subsection of this file is shown below, where the last line with the assertion is line 72:


function utils.BNtoFixed(net, ip)
  local net = net:replace(function(x)
      if torch.typename(x):find'BatchNormalization' then
        local no = x.running_mean:numel()
        local y = inn.ConstAffine(no, ip):type(x.running_mean:type())
        assert(x.running_var and not x.running_std)

Unfortunately I'm not able to find other information within the issues, and am not yet skilled enough in torch to be able to interpret this error/failed assertion. Is there a known solution to this issue?

Thanks

Error when running computeProposals.lua on own model

I'm interested in experimenting with training DeepMask/SharpMask against my own data, so as a first pass I'm following the instructions for training your own model against the COCO images and annotations.

When I run th computeProposals.lua against the resulting model directory, I get this error:

| loading model file... /Users/ryan/mess/current/deepmask/exps/deepmask/exp,batch=8,maxepoch=10
| start
/Users/ryan/source/torch/install/bin/luajit: bad argument #2 to '?' (out of range at /Users/ryan/source/torch/pkg/torch/generic/Tensor.c:890)
stack traceback:
        [C]: at 0x0b5e7600
        [C]: in function '__index'
        /Users/ryan/mess/2016/34/deepmask/InferDeepMask.lua:167: in function 'getTopScores'
        /Users/ryan/mess/2016/34/deepmask/InferDeepMask.lua:224: in function 'getTopProps'
        computeProposals.lua:84: in main chunk
        [C]: in function 'dofile'
        ...urce/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
        [C]: at 0x010b2a3cf0

I had to reduce the batch size to 8 to get train.lua to run on my GPU without a CUDA out of memory error, and I've tried multiple other tweaks and re-trainings with this batch size to see if something else would produce a training file that worked (I initially tried maxload 1000 with the default of 300 epochs, which is what initially produced this error).

evalPerPatch.lua runs fine against these custom models, evalPerImage.lua gives a similar error.

Running against the pre-trained DeepMask/SharpMask models also works fine.

Error when running deepmask

deep@deep:~/facebook/deepmask$ th computeProposals.lua pretrained/deepmask/ -img data/testImage.jpg
| loading model file... pretrained/deepmask/
| start
/home/deep/torch/install/bin/luajit: /home/deep/torch/install/share/lua/5.1/nn/Container.lua:67:
In 4 module of nn.Sequential:
/home/deep/torch/install/share/lua/5.1/nn/THNN.lua:109: wrong number of arguments for function call
stack traceback:
[C]: in function 'v'
/home/deep/torch/install/share/lua/5.1/nn/THNN.lua:109: in function 'SpatialMaxPooling_updateOutput'
...eep/torch/install/share/lua/5.1/nn/SpatialMaxPooling.lua:42: in function <...eep/torch/install/share/lua/5.1/nn/SpatialMaxPooling.lua:31>
[C]: in function 'xpcall'
/home/deep/torch/install/share/lua/5.1/nn/Container.lua:63: in function 'rethrowErrors'
/home/deep/torch/install/share/lua/5.1/nn/Sequential.lua:44: in function 'forward'
/home/deep/facebook/deepmask/InferDeepMask.lua:100: in function 'forward'
computeProposals.lua:81: in main chunk
[C]: in function 'dofile'
...deep/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
[C]: at 0x00406670

WARNING: If you see a stack trace below, it doesn't point to the place where this error occurred. Please use only the one above.
stack traceback:
[C]: in function 'error'
/home/deep/torch/install/share/lua/5.1/nn/Container.lua:67: in function 'rethrowErrors'
/home/deep/torch/install/share/lua/5.1/nn/Sequential.lua:44: in function 'forward'
/home/deep/facebook/deepmask/InferDeepMask.lua:100: in function 'forward'
computeProposals.lua:81: in main chunk
[C]: in function 'dofile'
...deep/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
[C]: at 0x00406670

How long it takes to train my own model in COCO

I have solved many problems before start my train. 
I have trained more than 36 hours, and i want to know how long i will takes.
I have configured deepmask with Ubuntu14.04 x_64, QUadro K1200 and , cuda7.5 and 8GB memory. Thanks sooooo much.
[test]  | epoch 00046 | IoU: mean 056.32 median 063.29 [email protected] 064.51 [email protected] 039.16 | acc 093.80 | bestmodel x   
[train] | epoch 00047 | s/batch 0.52 | loss: 0.15022    
[train] | epoch 00048 | s/batch 0.52 | loss: 0.15176    
[test]  | epoch 00048 | IoU: mean 057.66 median 065.18 [email protected] 067.07 [email protected] 041.83 | acc 093.45 | bestmodel *   
[train] | epoch 00049 | s/batch 0.52 | loss: 0.15329    
[train] | epoch 00050 | s/batch 0.52 | loss: 0.15199    
[test]  | epoch 00050 | IoU: mean 053.94 median 061.24 [email protected] 062.33 [email protected] 036.10 | acc 092.28 | bestmodel x   
[train] | epoch 00051 | s/batch 0.52 | loss: 0.13533    
[train] | epoch 00052 | s/batch 0.52 | loss: 0.14080    
[test]  | epoch 00052 | IoU: mean 055.73 median 062.66 [email protected] 065.35 [email protected] 039.00 | acc 094.34 | bestmodel x   
[train] | epoch 00053 | s/batch 0.52 | loss: 0.13487    
[train] | epoch 00054 | s/batch 0.52 | loss: 0.13435    
[test]  | epoch 00054 | IoU: mean 053.65 median 061.11 [email protected] 061.14 [email protected] 037.89 | acc 095.27 | bestmodel x   
[train] | epoch 00055 | s/batch 0.52 | loss: 0.13632    
[train] | epoch 00056 | s/batch 0.52 | loss: 0.13461    
[test]  | epoch 00056 | IoU: mean 057.91 median 064.97 [email protected] 067.39 [email protected] 042.86 | acc 094.26 | bestmodel *   
[train] | epoch 00057 | s/batch 0.52 | loss: 0.13303    
[train] | epoch 00058 | s/batch 0.52 | loss: 0.13234    
[test]  | epoch 00058 | IoU: mean 057.54 median 064.85 [email protected] 066.63 [email protected] 041.36 | acc 094.42 | bestmodel x   
[train] | epoch 00059 | s/batch 0.52 | loss: 0.13403    
[train] | epoch 00060 | s/batch 0.52 | loss: 0.12951    
[test]  | epoch 00060 | IoU: mean 059.21 median 065.52 [email protected] 069.41 [email protected] 043.63 | acc 095.10 | bestmodel *   
[train] | epoch 00061 | s/batch 0.52 | loss: 0.13767    
[train] | epoch 00062 | s/batch 0.52 | loss: 0.13817    
[test]  | epoch 00062 | IoU: mean 059.12 median 066.64 [email protected] 067.75 [email protected] 044.19 | acc 093.35 | bestmodel *   
[train] | epoch 00063 | s/batch 0.52 | loss: 0.13555    
[train] | epoch 00064 | s/batch 0.52 | loss: 0.13280    
[test]  | epoch 00064 | IoU: mean 057.84 median 065.11 [email protected] 068.10 [email protected] 042.38 | acc 094.01 | bestmodel x   
[train] | epoch 00065 | s/batch 0.52 | loss: 0.13282    
[train] | epoch 00066 | s/batch 0.52 | loss: 0.13261    
[test]  | epoch 00066 | IoU: mean 056.38 median 062.89 [email protected] 065.90 [email protected] 038.12 | acc 093.97 | bestmodel x   
[train] | epoch 00067 | s/batch 0.52 | loss: 0.13823    
[train] | epoch 00068 | s/batch 0.52 | loss: 0.13216    
[test]  | epoch 00068 | IoU: mean 058.44 median 065.97 [email protected] 068.68 [email protected] 044.07 | acc 094.71 | bestmodel x   
[train] | epoch 00069 | s/batch 0.52 | loss: 0.13481    
[train] | epoch 00070 | s/batch 0.52 | loss: 0.13227    
[test]  | epoch 00070 | IoU: mean 059.26 median 067.09 [email protected] 069.44 [email protected] 045.30 | acc 093.89 | bestmodel *   
[train] | epoch 00071 | s/batch 0.52 | loss: 0.13022    
[train] | epoch 00072 | s/batch 0.52 | loss: 0.13441    
[test]  | epoch 00072 | IoU: mean 059.67 median 068.14 [email protected] 069.61 [email protected] 047.18 | acc 094.78 | bestmodel *   
[train] | epoch 00073 | s/batch 0.52 | loss: 0.13493    
[train] | epoch 00074 | s/batch 0.52 | loss: 0.13066    
[test]  | epoch 00074 | IoU: mean 059.08 median 066.69 [email protected] 069.58 [email protected] 045.01 | acc 094.28 | bestmodel x

Problem loading model

./computeProposals.lua $DEEPMASK/pretrained/deepmask 

| loading model file... /home/ex/torches/deepmask/pretrained/deepmask   
/opt/torch/install/bin/luajit: /home/ex/torches/deepmask/modelUtils.lua:41: attempt to call method 'replace' (a nil value)
stack traceback:
    /home/ex/torches/deepmask/modelUtils.lua:41: in function 'linear2convTrunk'
    /home/ex/torches/deepmask/DeepMask.lua:156: in function 'inference'
    ./computeProposals.lua:51: in main chunk
    [C]: in function 'dofile'
    /opt/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
    [C]: at 0x00405d70


ls $DEEPMASK/pretrained/deepmask/
total 186004
drwxrwxr-x 2 ex      4096 Aug 26 21:02 .
drwxrwxr-x 4 ex      4096 Aug 26 21:02 ..
-rw-rw-r-- 1 ex 190265914 Aug 16 05:58 model.t7

Out of memory on Titan X while running computeProposals.lua

Getting out of memory on Titan X while running computeProposals.lua with images. Default image works fine (i.e testImage.jpg) but it runs out of memory when i feed my testing images of dim : (3264x2448). Is there a restriction in image dimensions?

error loading model

When I load deepmask model and sharpmask model in computeProposals.lua. Some error seem strange.
image
image
This is the two models md5sum result:
b4db9112a422acf74c75c9c15bbc3987 deepmask/model.t7
1767d49a3150617b9abfcd054c135afb sharpmask/model.t7

How to handle the error. Is the model.t7 problem or anything else?

Error running the quick start

Hi,

I am trying to run the quick start, and I get this error. Could you please advise?

/home/ai2-c3p0/torch/install/bin/luajit: cannot open </home/ai2-c3p0/Documents/code/k_working_directory/deepmask/sharpmask/model.t
7> in mode r at /home/ai2-c3p0/torch/pkg/torch/lib/TH/THDiskFile.c:649
stack traceback:
[C]: at 0x7f8cf053d7b0
[C]: in function 'DiskFile'
/home/ai2-c3p0/torch/install/share/lua/5.1/torch/File.lua:405: in function 'load'
computeProposals.lua:48: in main chunk
[C]: in function 'dofile'
...c3p0/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
[C]: at 0x00406670

Thanks,

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.