Giter Club home page Giter Club logo

warp-ctc's Introduction

PyTorch bindings for Warp-ctc

Build Status

This is an extension onto the original repo found here.

Installation

Install PyTorch v0.4.

WARP_CTC_PATH should be set to the location of a built WarpCTC (i.e. libwarpctc.so). This defaults to ../build, so from within a new warp-ctc clone you could build WarpCTC like this:

git clone https://github.com/SeanNaren/warp-ctc.git
cd warp-ctc
mkdir build; cd build
cmake ..
make

Now install the bindings:

cd pytorch_binding
python setup.py install

If you try the above and get a dlopen error on OSX with anaconda3 (as recommended by pytorch):

cd ../pytorch_binding
python setup.py install
cd ../build
cp libwarpctc.dylib /Users/$WHOAMI/anaconda3/lib

This will resolve the library not loaded error. This can be easily modified to work with other python installs if needed.

Example to use the bindings below.

import torch
from warpctc_pytorch import CTCLoss
ctc_loss = CTCLoss()
# expected shape of seqLength x batchSize x alphabet_size
probs = torch.FloatTensor([[[0.1, 0.6, 0.1, 0.1, 0.1], [0.1, 0.1, 0.6, 0.1, 0.1]]]).transpose(0, 1).contiguous()
labels = torch.IntTensor([1, 2])
label_sizes = torch.IntTensor([2])
probs_sizes = torch.IntTensor([2])
probs.requires_grad_(True)  # tells autograd to compute gradients for probs
cost = ctc_loss(probs, labels, probs_sizes, label_sizes)
cost.backward()

Documentation

CTCLoss(size_average=False, length_average=False)
    # size_average (bool): normalize the loss by the batch size (default: False)
    # length_average (bool): normalize the loss by the total number of frames in the batch. If True, supersedes size_average (default: False)

forward(acts, labels, act_lens, label_lens)
    # acts: Tensor of (seqLength x batch x outputDim) containing output activations from network (before softmax)
    # labels: 1 dimensional Tensor containing all the targets of the batch in one large sequence
    # act_lens: Tensor of size (batch) containing size of each output sequence from the network
    # label_lens: Tensor of (batch) containing label length of each example

warp-ctc's People

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

warp-ctc's Issues

ImportError: No module named _warp_ctc

After I finish "python setup.py install", when i test the "test.py" in folder "pytorch_binding/tests", i find this error below:
Traceback (most recent call last):
File "test.py", line 9, in
from warpctc_pytorch import CTCLoss
File "build/bdist.linux-x86_64/egg/warpctc_pytorch/init.py", line 8, in
ImportError: No module named _warp_ctc

Should use C99 mode in gcc

/root/anaconda3/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h: In function ‘TH_polevlf’:
/root/anaconda3/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h:142:3: error: ‘for’ loop initial declarations are only allowed in C99 mode
for (size_t i = 0; i <= len; i++) {
^
/root/anaconda3/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h: In function ‘TH_trigamma’:
/root/anaconda3/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h:260:3: error: ‘for’ loop initial declarations are only allowed in C99 mode
for (int i = 0; i < 6; ++i) {
^
/root/anaconda3/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h: In function ‘TH_trigammaf’:
/root/anaconda3/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h:278:3: error: ‘for’ loop initial declarations are only allowed in C99 mode
for (int i = 0; i < 6; ++i) {
^
error: command 'gcc' failed with exit status 1

Should add -std=c99 in setup.py

Data Parallel not supported

Hi,

While using CTCLoss as a submodule in pytorch, I found that CTCLoss cannot work with multi GPU.

The reason is that torch.nn.DataParallel ensures all submodules will be under parallel mode, and the input of forward function should be all torch.Tensor and the dim of input tensor should be at least 2, since data parallel will split the tensor by dim 0.

However, the input(2,3,4) of CTCLoss forward should be 1-dimensional according to README.

The case of CTCLoss as a submodule of another nn.Module

class Network(nn.Module):
    ...
    def __init__(self):
        self.criterion = CTCLoss()

I've print the tensor size before calling CTCLoss.foward()

data size before warp ctc
torch.Size([82, 16, 34]) torch.Size([35]) torch.Size([16]) torch.Size([16]) 

The error shows like the following

data size before warp ctc
torch.Size([82, 16, 34]) torch.Size([35]) torch.Size([16]) torch.Size([16]) 
Traceback (most recent call last):
  File "train.py", line 473, in <module>
    train()
  File "train.py", line 300, in train
    target_det=target_det, target_ctc=target_ctc, target_sizes=target_sizes)
  File "/home/charlie_huang/virtual3/lib/python3.5/site-packages/torch/nn/modules/module.py", line 491, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/charlie_huang/virtual3/lib/python3.5/site-packages/torch/nn/parallel/data_parallel.py", line 115, in forward
    return self.gather(outputs, self.output_device)
  File "/home/charlie_huang/virtual3/lib/python3.5/site-packages/torch/nn/parallel/data_parallel.py", line 127, in gather
    return gather(outputs, output_device, dim=self.dim)
  File "/home/charlie_huang/virtual3/lib/python3.5/site-packages/torch/nn/parallel/scatter_gather.py", line 68, in gather
    return gather_map(outputs)
  File "/home/charlie_huang/virtual3/lib/python3.5/site-packages/torch/nn/parallel/scatter_gather.py", line 63, in gather_map
    return type(out)(map(gather_map, zip(*outputs)))
  File "/home/charlie_huang/virtual3/lib/python3.5/site-packages/torch/nn/parallel/scatter_gather.py", line 55, in gather_map
    return Gather.apply(target_device, dim, *outputs)
  File "/home/charlie_huang/virtual3/lib/python3.5/site-packages/torch/nn/parallel/_functions.py", line 54, in forward
    ctx.input_sizes = tuple(map(lambda i: i.size(ctx.dim), inputs))
  File "/home/charlie_huang/virtual3/lib/python3.5/site-packages/torch/nn/parallel/_functions.py", line 54, in <lambda>
    ctx.input_sizes = tuple(map(lambda i: i.size(ctx.dim), inputs))
RuntimeError: dimension specified as 0 but tensor has no dimensions

Any idea to fix this?
Many Thanks.

problem with installing warpctc_pytorch(cuda 9.2, pytorch 0.4.0)

Errors as below:
/warp-ctc-pytorch_bindings/pytorch_binding/src/binding.cpp: In function ‘int gpu_ctc(THCudaTensor*, THCudaTensor*, THIntTensor*, THIntTensor*, THIntTensor*, int, THFloatTensor*, int)’:
/warp-ctc-pytorch_bindings/pytorch_binding/src/binding.cpp:92:49: error: cannot convert ### _‘THCudaTensor’ to ‘const THFloatTensor’ for argument ‘1’ to ‘int64_t THFloatTensor_size(const THFloatTensor*, int)’_**
int probs_size = THFloatTensor_size(probs, 2);
^
/home/ncl/hdp/03_pythonPackage/01_warpctc/warp-ctc-pytorch_bindings/pytorch_binding/src/binding.cpp:106:66: error: cannot convert ‘cudaError_t {aka cudaError}’ to ‘void*’ in initialization
void* gpu_workspace = THCudaMalloc(state,NULL, gpu_size_bytes);
^
error: command 'gcc' failed with exit status 1

I try to resolve the first error using the function THCudaTensor_size , so the corresponding code should be:
int probs_size = THCudaTensor_size(probs,2);

It really worked , however , I have no idea to deal with the second one.
Anybody any ideas?

CTC support pytorch0.3 problem

when I update my pytorch0.2 to pytorch0.3 , the CTC loss raise following error:

GPU execution requested, but not compiled with GPU support

and I uninstall warp_ctc_pytorch , and rebuild , the error still appears. is there any idea to solve this problem?

Error in recent update of pytorch

Hi,

I've got some unknown error msg with latest pytorch update (0.4.0a0+8910dd5):

Traceback (most recent call last):
  File "train.py", line 343, in <module>
    loss.backward()
  File "/home/jbaik/.pyenv/versions/3.6.4/lib/python3.6/site-packages/torch/autograd/variable.py", line 128, in backward
    torch.autograd.backward(self, gradient, retain_graph, create_graph)
  File "/home/jbaik/.pyenv/versions/3.6.4/lib/python3.6/site-packages/torch/autograd/__init__.py", line 83, in backward
    variables, grad_variables, retain_graph, create_graph)
RuntimeError: expected Variable (got 'torch.cuda.FloatTensor')'

from the deepspeech.pytorch project. It looks like the warp_ctc generates this, so I reported here.

error while installing warp-ctc

Following is the error I am getting while running the make command:

**_nvcc fatal : A single input file is required for a non-link phase when an outputfile is specified
CMake Error at CMakeFiles/warpctc_generated_reduce.cu.o.cmake:198 (message):
Error generating
/home/srib/end2end/espnet-master/tools/warp-ctc/build/./warpctc_generated_reduce.cu.o

make[2]: *** [warpctc_generated_reduce.cu.o] Error 1
make[1]: *** [CMakeFiles/warpctc.dir/all] Error 2
make: *** [all] Error 2_**

Can someone please help me with some pointers on how to resolve this issue?

thanks

error: unsupported option '-fopenmp'

Environment: Mac OSX

cmake ../ 

output info:

-- The C compiler identification is AppleClang 9.0.0.9000039
-- The CXX compiler identification is AppleClang 9.0.0.9000039
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc
-- Check for working C compiler: /Library/Developer/CommandLineTools/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: /Library/Developer/CommandLineTools/usr/bin/c++
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CUDA_TOOLKIT_ROOT_DIR not found or specified
-- Could NOT find CUDA (missing: CUDA_TOOLKIT_ROOT_DIR CUDA_NVCC_EXECUTABLE CUDA_INCLUDE_DIRS CUDA_CUDART_LIBRARY) (Required is at least version "6.5")
-- cuda found FALSE
CMake Warning at CMakeLists.txt:59 (FIND_PACKAGE):
  By not providing "FindTorch.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Torch", but
  CMake did not find one.

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

    TorchConfig.cmake
    torch-config.cmake

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


-- Torch found Torch_DIR-NOTFOUND
-- DARWIN_VERSION=17
-- Building shared library with no GPU support
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/cdong/projects/python/warp-ctc/build

then

make
clang: error: unsupported option '-fopenmp'
make[2]: *** [CMakeFiles/warpctc.dir/src/ctc_entrypoint.cpp.o] Error 1
make[1]: *** [CMakeFiles/warpctc.dir/all] Error 2
make: *** [all] Error 2

is this can support only cpu pytorch? as I have got the error

CUDA_TOOLKIT_ROOT_DIR not found or specified
-- Could NOT find CUDA (missing: CUDA_TOOLKIT_ROOT_DIR CUDA_NVCC_EXECUTABLE CUDA_INCLUDE_DIRS CUDA_CUDART_LIBRARY) (Required is at least version "6.5")
-- cuda found FALSE
-- Building shared library with no GPU support
-- Configuring done
-- Generating done

installing pytorch binding

Hi

I get the following error while installing pytorch binding (sudo python setup.py install):

generating build/warpctc_pytorch/_warp_ctc/__warp_ctc.c
(already up-to-date)
not modified: 'build/warpctc_pytorch/_warp_ctc/__warp_ctc.c'
running install
running bdist_egg
running egg_info
writing warpctc_pytorch.egg-info/PKG-INFO
writing top-level names to warpctc_pytorch.egg-info/top_level.txt
writing dependency_links to warpctc_pytorch.egg-info/dependency_links.txt
reading manifest file 'warpctc_pytorch.egg-info/SOURCES.txt'
writing manifest file 'warpctc_pytorch.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
copying warpctc_pytorch/_warp_ctc/init.py -> build/lib.linux-x86_64-2.7/warpctc_pytorch/_warp_ctc
running build_ext
building 'warpctc_pytorch._warp_ctc.__warp_ctc' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include/TH -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/home/sobhe/repo/warp-ctc/include -I/usr/include/python2.7 -c build/warpctc_pytorch/_warp_ctc/__warp_ctc.c -o build/temp.linux-x86_64-2.7/build/warpctc_pytorch/_warp_ctc/__warp_ctc.o -std=c++11 -fPIC -std=c99 -DWARPCTC_ENABLE_GPU
cc1: warning: command line option ‘-std=c++11’ is valid for C++/ObjC++ but not for C
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include/TH -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/home/sobhe/repo/warp-ctc/include -I/usr/include/python2.7 -c /home/sobhe/repo/warp-ctc/pytorch_binding/src/binding.cpp -o build/temp.linux-x86_64-2.7/home/sobhe/repo/warp-ctc/pytorch_binding/src/binding.o -std=c++11 -fPIC -std=c99 -DWARPCTC_ENABLE_GPU
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
cc1plus: warning: command line option ‘-std=c99’ is valid for C/ObjC but not for C++
/home/sobhe/repo/warp-ctc/pytorch_binding/src/binding.cpp: In function ‘int gpu_ctc(THCudaTensor*, THCudaTensor*, THIntTensor*, THIntTensor*, THIntTensor*, int, THFloatTensor*, int)’:
/home/sobhe/repo/warp-ctc/pytorch_binding/src/binding.cpp:92:49: error: cannot convert ‘THCudaTensor*’ to ‘const THFloatTensor*’ for argument ‘1’ to ‘int64_t THFloatTensor_size(const THFloatTensor*, int)’
int probs_size = THFloatTensor_size(probs, 2);
^
/home/sobhe/repo/warp-ctc/pytorch_binding/src/binding.cpp:105:61: error: invalid conversion from ‘size_t {aka long unsigned int}’ to ‘void**’ [-fpermissive]
void* gpu_workspace = THCudaMalloc(state, gpu_size_bytes);
^
/home/sobhe/repo/warp-ctc/pytorch_binding/src/binding.cpp:105:61: error: too few arguments to function ‘cudaError_t THCudaMalloc(THCState*, void**, size_t)’
In file included from /usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include/THC/THC.h:4:0,
from /home/sobhe/repo/warp-ctc/pytorch_binding/src/binding.cpp:9:
/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include/THC/THCGeneral.h:209:21: note: declared here
THC_API cudaError_t THCudaMalloc(THCState *state, void **ptr, size_t size);
^
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

Please help me with this error.

P.S. I get the same error with either gcc-4.8 or gcc-5.4 & CUDA 8.0

ImportError....undefined symbol

after python setup.py install, I run test.py, and get this:

Traceback (most recent call last):
  File "test.py", line 8, in <module>
    from warpctc_pytorch import CTCLoss
  File "/usr/local/lib/python3.4/dist-packages/warpctc_pytorch/__init__.py", line 8, in <module>
    from ._warp_ctc import lib as _lib, ffi as _ffi
ImportError: /usr/local/lib/python3.4/dist-packages/warpctc_pytorch/_warp_ctc.cpython-34m.so: undefined symbol: _Z7cpu_ctcP13THFloatTensorS0_P11THIntTensorS2_S2_iS0_

It doesn't support python3.4 ?

cmake not found : using google colab

I tried to install this on Google Colab.
after successfully cloning it , it gives following error on cmake command

!cmake ..
!make
/bin/sh: 1: cmake: not found
make: *** No targets specified and no makefile found.  Stop.

can anyone help me with this?

error : attribute 'gpu_ctc'

there is a mistake about warp-ctc, I am not sure whether the installation is wrong.

criterion = CTCLoss()
criterion = criterion.cuda()
cost = criterion(preds, text, preds_size, length) / batch_size
File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py", line 325, in call
result = self.forward(*input, **kwargs)
File "build/bdist.linux-x86_64/egg/warpctc_pytorch/init.py", line 76, in forward
File "build/bdist.linux-x86_64/egg/warpctc_pytorch/init.py", line 17, in forward
AttributeError: 'module' object has no attribute 'gpu_ctc'

error: invalid argument '-std=c++11' not allowed with 'C/ObjC'

the "invalid argument '-std=c++11' not allowed with 'C/ObjC'" occured when try to use python setup.py install in pytorch_binding.

Full Operation History:

cmake ../ -DWITH_OMP=OFF

the cmake info:

-- The C compiler identification is AppleClang 9.0.0.9000039
-- The CXX compiler identification is AppleClang 9.0.0.9000039
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc
-- Check for working C compiler: /Library/Developer/CommandLineTools/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: /Library/Developer/CommandLineTools/usr/bin/c++
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CUDA_TOOLKIT_ROOT_DIR not found or specified
-- Could NOT find CUDA (missing: CUDA_TOOLKIT_ROOT_DIR CUDA_NVCC_EXECUTABLE CUDA_INCLUDE_DIRS CUDA_CUDART_LIBRARY) (Required is at least version "6.5")
-- cuda found FALSE
CMake Warning at CMakeLists.txt:59 (FIND_PACKAGE):
  By not providing "FindTorch.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Torch", but
  CMake did not find one.

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

    TorchConfig.cmake
    torch-config.cmake

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


-- Torch found Torch_DIR-NOTFOUND
-- DARWIN_VERSION=17
-- Building shared library with no GPU support
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/cdong/projects/python/warp-ctc/build
make
Scanning dependencies of target warpctc
[ 25%] Building CXX object CMakeFiles/warpctc.dir/src/ctc_entrypoint.cpp.o
[ 50%] Linking CXX shared library libwarpctc.dylib
[ 50%] Built target warpctc
Scanning dependencies of target test_cpu
[ 75%] Building CXX object CMakeFiles/test_cpu.dir/tests/test_cpu.cpp.o
[100%] Linking CXX executable test_cpu
[100%] Built target test_cpu
cd ../pytorch_binding/
python setup.py install

the error occured.

CUDA_HOME not found in the environment so building without GPU support. To build with GPU support please define the CUDA_HOME environment variable. This should be a path which contains include/cuda.h
generating build/_warp_ctc.c
regenerated: 'build/_warp_ctc.c'
running install
running build
running build_py
creating build/lib.macosx-10.6-x86_64-3.5
creating build/lib.macosx-10.6-x86_64-3.5/warpctc_pytorch
copying warpctc_pytorch/__init__.py -> build/lib.macosx-10.6-x86_64-3.5/warpctc_pytorch
running build_ext
building 'warpctc_pytorch._warp_ctc' extension
creating build/temp.macosx-10.6-x86_64-3.5
creating build/temp.macosx-10.6-x86_64-3.5/build
creating build/temp.macosx-10.6-x86_64-3.5/Users
creating build/temp.macosx-10.6-x86_64-3.5/Users/cdong
creating build/temp.macosx-10.6-x86_64-3.5/Users/cdong/projects
creating build/temp.macosx-10.6-x86_64-3.5/Users/cdong/projects/python
creating build/temp.macosx-10.6-x86_64-3.5/Users/cdong/projects/python/warp-ctc
creating build/temp.macosx-10.6-x86_64-3.5/Users/cdong/projects/python/warp-ctc/pytorch_binding
creating build/temp.macosx-10.6-x86_64-3.5/Users/cdong/projects/python/warp-ctc/pytorch_binding/src
/usr/bin/clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/cdong/projects/python/dnn-model-ocr/envs/default/include -arch x86_64 -I/Users/cdong/projects/python/dnn-model-ocr/envs/default/include -arch x86_64 -I/Users/cdong/projects/python/dnn-model-ocr/envs/default/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include -I/Users/cdong/projects/python/dnn-model-ocr/envs/default/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH -I/Users/cdong/projects/python/warp-ctc/include -I/Users/cdong/projects/python/dnn-model-ocr/envs/default/include/python3.5m -c build/_warp_ctc.c -o build/temp.macosx-10.6-x86_64-3.5/build/_warp_ctc.o -std=c++11 -fPIC
error: invalid argument '-std=c++11' not allowed with 'C/ObjC'
error: command '/usr/bin/clang' failed with exit status 1

loss not converging

I'm training a CRNN to do captcha recognition. Without CTC, it reach 90% sequence for certain type of captcha. The problem is it can only recognize captchas with similar character segmentation. So I tried this CTC pytorch binding. But the loss, both training and eval loss, decrease only in the beginning. Then, it reach some plateau without further dropping. My model detail is Resnet pretrained CNN layer + Bidirectional LSTM + Fully Connected layer + CTC. Tried different layers and units of LSTM, different opimizers, curriculum learning. Nothing seems to work. For variable length captcha recognition, I found that the plateau value is dependent on the length of captcha. The longer the captcha, the higher the loss. I'm using 432cf33 commit of ctc pytorch binding since when I was installing, commit abed5eb causes installation failure. I don't know if this matters. No idea what is wrong. If there is any important tricks training CRNN using CTC, please let me know. Here is my model code below. It can not be run since it is just part of a project. But it's enough to give you an overview of my model.

#encoding:utf8
import os
import sys
import torch
import warpctc_pytorch
import traceback

import torchvision
from torch import nn, autograd, FloatTensor, optim
from torch.nn import functional as F
from torch.utils.data import DataLoader
from torch.optim.lr_scheduler import MultiStepLR
from tensorboard import SummaryWriter
from pprint import pprint

from net.utils import decoder

from logging import getLogger, StreamHandler
logger = getLogger(__name__)
handler = StreamHandler(sys.stdout)
logger.addHandler(handler)

from dataset_util.utils import id_to_character
from dataset_util.transform import rescale, normalizer
from config.config import MAX_CAPTCHA_LENGTH, TENSORBOARD_LOG_PATH, MODEL_PATH


class CNN_RNN(nn.Module):
    def __init__(self, lstm_bidirectional=True, use_ctc=True, *args, **kwargs):
        super(CNN_RNN, self).__init__(*args, **kwargs)
        model_conv = torchvision.models.resnet18(pretrained=True)
        # for param in model_conv.parameters():
        #     param.requires_grad = False
        #
        modules = list(model_conv.children())[:-1]  # delete the last fc layer.
        # for param in modules[8].parameters():
        #     param.requires_grad = True

        self.resnet = nn.Sequential(*modules)            # CNN with fixed parameters from resnet as feature extractor
        self.lstm_input_size = 512 * 2 * 2
        self.lstm_hidden_state_size = 512
        self.lstm_num_layers = 2
        self.chracter_space_length = 64
        self._lstm_bidirectional = lstm_bidirectional
        self._use_ctc = use_ctc
        if use_ctc:
            # self._max_captcha_length = int(MAX_CAPTCHA_LENGTH * 2)
            self._max_captcha_length = 8
        else:
            self._max_captcha_length = MAX_CAPTCHA_LENGTH

        if lstm_bidirectional:
            self.lstm_hidden_state_size = self.lstm_hidden_state_size * 2           # so that hidden size for one direction in bidirection lstm is the same as vanilla lstm
            self.lstm = self.lstm = nn.LSTM(self.lstm_input_size, self.lstm_hidden_state_size // 2, dropout=0.5, bidirectional=True, num_layers=self.lstm_num_layers)
        else:
            self.lstm = nn.LSTM(self.lstm_input_size, self.lstm_hidden_state_size, dropout=0.5, bidirectional=False, num_layers=self.lstm_num_layers)  # dropout doen't work for one layer lstm

        self.ouput_to_tag = nn.Linear(self.lstm_hidden_state_size, self.chracter_space_length)
        # self.dropout_lstm = nn.Dropout()


    def init_hidden_status(self, batch_size):
        if self._lstm_bidirectional:
            self.hidden = (autograd.Variable(torch.zeros((self.lstm_num_layers * 2, batch_size, self.lstm_hidden_state_size // 2))),
                           autograd.Variable(torch.zeros((self.lstm_num_layers * 2, batch_size, self.lstm_hidden_state_size // 2)))) # number of layers, batch size, hidden dimention
        else:
            self.hidden = (autograd.Variable(torch.zeros((self.lstm_num_layers, batch_size, self.lstm_hidden_state_size))),
                           autograd.Variable(torch.zeros((self.lstm_num_layers, batch_size, self.lstm_hidden_state_size)))) # number of layers, batch size, hidden dimention


    def forward(self, image):
        '''
        :param image:  # batch_size, CHANNEL, HEIGHT, WIDTH
        :return:
        '''
        features = self.resnet(image)                 # [batch_size, 512, 2, 2]
        batch_size = image.shape[0]
        features = [features.view(batch_size, -1) for i in range(self._max_captcha_length)]
        features = torch.stack(features)
        self.init_hidden_status(batch_size)
        output, hidden = self.lstm(features, self.hidden)
        # output = self.dropout_lstm(output)
        tag_space = self.ouput_to_tag(output.view(-1, output.size(2)))      # [MAX_CAPTCHA_LENGTH * BATCH_SIZE, CHARACTER_SPACE_LENGTH]
        tag_space = tag_space.view(self._max_captcha_length, batch_size, -1)

        if not self._use_ctc:
            tag_score = F.log_softmax(tag_space, dim=2)             # [MAX_CAPTCHA_LENGTH, BATCH_SIZE, CHARACTER_SPACE_LENGTH]
        else:
            tag_score = tag_space

        return tag_score


    def save_model(self, model_path):
        torch.save(self, model_path)


    @classmethod
    def load_model(cls, model_path=MODEL_PATH, *args, **kwargs):
        if os.path.exists(model_path):
            model = torch.load(model_path)
            net = model
        else:
            net = cls(*args, **kwargs)

        return net



class Trainer(object):
    def __init__(self, model, use_ctc=True):
        self.model = model
        self._use_ctc = use_ctc
        self.tensorboard_writer = SummaryWriter(TENSORBOARD_LOG_PATH)


    def __del__(self):
        if self.tensorboard_writer:
            self.tensorboard_writer.close()


    def train_net(self, data_loader, eval_data_loader=None, learning_rate=0.008, epoch_num=400):
        try:
            if self._use_ctc:
                loss_function = warpctc_pytorch.warp_ctc.CTCLoss()
            else:
                loss_function = nn.NLLLoss()

            # optimizer = optim.SGD(filter(lambda p: p.requires_grad, self.model.parameters()), momentum=0.2, lr=learning_rate)
            # optimizer = optim.RMSprop(filter(lambda p: p.requires_grad, self.model.parameters()), lr=learning_rate)
            # optimizer = MultiStepLR(optimizer, milestones=[10,15], gamma=0.5)
            optimizer = optim.Adagrad(filter(lambda p: p.requires_grad, self.model.parameters()))

            # optimizer = optim.Adadelta(filter(lambda p: p.requires_grad, self.parameters()))
            # optimizer = optim.Adam(filter(lambda p: p.requires_grad, self.model.parameters()))
            self.tensorboard_writer.add_scalar("learning_rate", learning_rate)

            tensorbard_global_step=0
            if os.path.exists(os.path.join(TENSORBOARD_LOG_PATH, "resume_step")):
                with open(os.path.join(TENSORBOARD_LOG_PATH, "resume_step"), "r") as file_handler:
                    tensorbard_global_step = int(file_handler.read()) + 1

            for epoch_index, epoch in enumerate(range(epoch_num)):
                for index, sample in enumerate(data_loader):
                    optimizer.zero_grad()
                    input_image = autograd.Variable(sample["image"])        # batch_size, 3, 255, 255
                    tag_score = self.model.forward(input_image)

                    if self._use_ctc:
                        tag_score, target, tag_score_sizes, target_sizes = self._loss_preprocess_ctc(tag_score, sample)
                        loss = loss_function(tag_score, target, tag_score_sizes, target_sizes)
                        loss = loss / tag_score.size(1) / self.model._max_captcha_length

                    else:
                        target = sample["padded_label_idx"]
                        tag_score, target = self._loss_preprocess(tag_score, target)
                        loss = loss_function(tag_score, target)

                    print("Training loss: {}".format(float(loss)))
                    self.tensorboard_writer.add_scalar("training_loss", float(loss), tensorbard_global_step)
                    loss.backward()

                    # torch.nn.utils.clip_grad_norm(self.model.lstm.parameters(), 0.5)
                    # for param_index, parameter in enumerate(self.model.lstm.parameters()):
                    #     parameter_sqrt_square_mean = torch.mean(torch.sqrt(torch.mul(parameter, parameter)))
                    #     self.tensorboard_writer.add_scalar("lstm_grad_mean_{}".format(param_index), float(parameter_sqrt_square_mean), tensorbard_global_step)

                    optimizer.step()

                    if index % 250 == 0:
                        print(u"Processing batch: {} of {}, epoch: {}".format(index, len(data_loader), epoch_index))
                        self.evaluate(eval_data_loader, loss_function, tensorbard_global_step)

                    tensorbard_global_step += 1

                self.model.save_model(MODEL_PATH + "_epoch_{}".format(epoch_index))

        except KeyboardInterrupt:
            print("Exit for KeyboardInterrupt, save model")
            self.model.save_model(MODEL_PATH)

            with open(os.path.join(TENSORBOARD_LOG_PATH, "resume_step"), "w") as file_handler:
                file_handler.write(str(tensorbard_global_step))

        except Exception as excp:
            logger.error(str(excp))
            logger.error(traceback.format_exc())


    def predict(self, image):
        # TODO ctc version
        '''
        :param image: [batch_size, channel, height, width]
        :return:
        '''
        tag_score = self.model.forward(image)
        # TODO ctc
        # if self._use_ctc:
        #     tag_score = F.softmax(tag_score, dim=-1)
        #     decoder.decode(tag_score)

        confidence_log_probability, indexes = tag_score.max(2)

        predicted_labels = []
        for batch_index in range(indexes.size(1)):
            label = ""
            for character_index in range(self.model._max_captcha_length):
                if int(indexes[character_index, batch_index]) != 1:
                    label += id_to_character[int(indexes[character_index, batch_index])]
            predicted_labels.append(label)

        return predicted_labels, tag_score


    def predict_pil_image(self, pil_image):
        try:
            self.model.eval()
            processed_image = normalizer(rescale({"image": pil_image}))["image"].view(1, 3, 255, 255)
            result, tag_score = self.predict(processed_image)
            self.model.train()

        except Exception as excp:
            logger.error(str(excp))
            logger.error(traceback.format_exc())
            return [""], None

        return result, tag_score


    def evaluate(self, eval_dataloader, loss_function, step=0):
        total = 0
        sequence_correct = 0
        character_correct = 0
        character_total = 0
        loss_total = 0
        batch_size = eval_data_loader.batch_size
        true_predicted = {}
        self.model.eval()
        for sample in eval_dataloader:
            total += batch_size
            input_images = sample["image"]
            predicted_labels, tag_score = self.predict(input_images)

            for predicted, true_label in zip(predicted_labels, sample["label"]):
                if predicted == true_label:                  # dataloader is making label a list, use batch_size=1
                    sequence_correct += 1

                for index, true_character in enumerate(true_label):
                    character_total += 1
                    if index < len(predicted) and predicted[index] == true_character:
                        character_correct += 1

                true_predicted[true_label] = predicted

            if self._use_ctc:
                tag_score, target, tag_score_sizes, target_sizes = self._loss_preprocess_ctc(tag_score, sample)
                loss_total += float(loss_function(tag_score, target, tag_score_sizes, target_sizes) / batch_size / self.model._max_captcha_length)

            else:
                tag_score, target = self._loss_preprocess(tag_score, sample["padded_label_idx"])
                loss_total += float(loss_function(tag_score, target))  # averaged over batch index

        print("True captcha to predicted captcha: ")
        pprint(true_predicted)
        self.tensorboard_writer.add_text("eval_ture_to_predicted", str(true_predicted), global_step=step)

        accuracy = float(sequence_correct) / total
        avg_loss = float(loss_total) / (total / batch_size)
        character_accuracy = float(character_correct) / character_total
        self.tensorboard_writer.add_scalar("eval_sequence_accuracy", accuracy, global_step=step)
        self.tensorboard_writer.add_scalar("eval_character_accuracy", character_accuracy, global_step=step)
        self.tensorboard_writer.add_scalar("eval_loss", avg_loss, global_step=step)
        self.model.train()


    def _loss_preprocess(self, tag_score, target):
        '''
        :param tag_score:  value return by self.forward
        :param target:     sample["padded_label_idx"]
        :return:           (processed_tag_score, processed_target)  ready for NLLoss function
        '''
        target = target.transpose(0, 1)
        target = target.contiguous()
        target = target.view(target.size(0) * target.size(1))
        tag_score = tag_score.view(-1, self.model.chracter_space_length)

        return tag_score, target


    def _loss_preprocess_ctc(self, tag_score, sample):
        target_2d = [
            [int(ele) for ele in sample["padded_label_idx"][row, :] if int(ele) != 0 and int(ele) != 1]
            for row in range(sample["padded_label_idx"].size(0))]
        target = []
        for ele in target_2d:
            target.extend(ele)
        target = autograd.Variable(torch.IntTensor(target))

        # tag_score = F.softmax(F.sigmoid(tag_score), dim=-1)
        tag_score_sizes = autograd.Variable(torch.IntTensor([self.model._max_captcha_length] * tag_score.size(1)))
        target_sizes = autograd.Variable(sample["captcha_length"].int())

        return tag_score, target, tag_score_sizes, target_sizes


if __name__ == "__main__":
    from dataset_util.dataset import dataset, eval_dataset
    data_loader = DataLoader(dataset, batch_size=3, shuffle=True)
    eval_data_loader = DataLoader(eval_dataset, batch_size=3, shuffle=True)

    net = CNN_RNN.load_model(model_path=MODEL_PATH, lstm_bidirectional=True, use_ctc=True)
    trainer = Trainer(model=net, use_ctc=True)

    trainer.train_net(data_loader, eval_data_loader=eval_data_loader)
    # net.predict(dataset[0]["image"].view(1, 3, 255, 255))

    # predict_pil_image test code
    # from config.config import IMAGE_PATHS
    # import glob
    # from PIL import Image
    #
    # image_paths = glob.glob(os.path.join(IMAGE_PATHS.get("EVAL"), "*.png"))
    # for image_path in image_paths:
    #     pil_image = Image.open(image_path)
    #     predicted, score = net.predict_pil_image(pil_image)
    #     print("True value: {}, predicted: {}".format(os.path.split(image_path)[1], predicted))

    print("Done")

Predictions are all _BLANK characters

I am training crnn.pytorch (https://github.com/meijieru/crnn.pytorch) to recognize handwritten characters. The training loss does not decrease and the predictions are all blank characters. The warpctc passed all the tests. Also, I double checked the input images and labels. Does anyone have this issue before? Thanks. I am using Pytorch 0.4.0 and the current version of warp-ctc.

Error while Installing Warp-ctc

~/warp-ctc/build$ make
[ 11%] Building NVCC (Device) object CMakeFiles/warpctc.dir/src/warpctc_generated_reduce.cu.o
In file included from /usr/local/cuda-9.0/include/host_config.h:50:0,
from /usr/local/cuda-9.0/include/cuda_runtime.h:78,
from :0:
/usr/local/cuda-9.0/include/crt/host_config.h:119:2: error: #error -- unsupported GNU version! gcc versions later than 6 are not supported!
#error -- unsupported GNU version! gcc versions later than 6 are not supported!
^~~~~
CMake Error at warpctc_generated_reduce.cu.o.cmake:219 (message):
Error generating
/home/tikam/warp-ctc/build/CMakeFiles/warpctc.dir/src/./warpctc_generated_reduce.cu.o

CMakeFiles/warpctc.dir/build.make:70: recipe for target 'CMakeFiles/warpctc.dir/src/warpctc_generated_reduce.cu.o' failed
make[2]: *** [CMakeFiles/warpctc.dir/src/warpctc_generated_reduce.cu.o] Error 1
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/warpctc.dir/all' failed
make[1]: *** [CMakeFiles/warpctc.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

pytorch 0.3

Hi, thank you for sharing the wonderful job!
I just want to know whether it's compatible to pytorch 0.3?
Looking forward to your reply.

Compiled versions

Is there any possibility to have compiled versions available for different GCC/CUDA targets?
I (and as I can see others as well) am having lots of trouble compiling, both the binaries and the python binding.

build WarpCTC process : make---clang: error: unsupported option '-fopenmp'

when i build WarpCTC in my mac ,until run 'make' command in command line , it stoped by error 'clang: error: unsupported option '-fopenmp'' , did i use the wrong compiler? so i just brew gcc ,and set the CC envirment variable ,like "export CC=/usr/bin/gcc; CXX=/usr/bin/g++;MPICXX=/usr/bin/mpicxx;" but this error still ocurred ,so excusted ,can you dalaos help me ?

Install error

Hi, I'm trying to install warp-ctc with Python 3.6.5, PyTorch 0.5.0a0+3cb45ba and cuda 9.2. But I got errors as follows:

$ python setup.py install
generating build/warpctc_pytorch/_warp_ctc/__warp_ctc.c
(already up-to-date)
not modified: 'build/warpctc_pytorch/_warp_ctc/__warp_ctc.c'
running install
running bdist_egg
running egg_info
writing warpctc_pytorch.egg-info/PKG-INFO
writing dependency_links to warpctc_pytorch.egg-info/dependency_links.txt
writing top-level names to warpctc_pytorch.egg-info/top_level.txt
reading manifest file 'warpctc_pytorch.egg-info/SOURCES.txt'
writing manifest file 'warpctc_pytorch.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
copying warpctc_pytorch/_warp_ctc/__init__.py -> build/lib.linux-x86_64-3.6/warpctc_pytorch/_warp_ctc
running build_ext
building 'warpctc_pytorch._warp_ctc.__warp_ctc' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include -I/home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH -I/home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/home/jbaik/setup/pytorch/sn.warp-ctc/include -I/home/jbaik/.pyenv/versions/3.6.5/include/python3.6m -c build/warpctc_pytorch/_warp_ctc/__warp_ctc.c -o build/temp.linux-x86_64-3.6/build/warpctc_pytorch/_warp_ctc/__warp_ctc.o -std=c99 -std=c++11 -fPIC -DWARPCTC_ENABLE_GPU
cc1: warning: command line option ‘-std=c++11’ is valid for C++/ObjC++ but not for C [enabled by default]
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include -I/home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH -I/home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/home/jbaik/setup/pytorch/sn.warp-ctc/include -I/home/jbaik/.pyenv/versions/3.6.5/include/python3.6m -c /home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp -o build/temp.linux-x86_64-3.6/home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.o -std=c99 -std=c++11 -fPIC -DWARPCTC_ENABLE_GPU
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
cc1plus: warning: command line option ‘-std=c99’ is valid for C/ObjC but not for C++ [enabled by default]
/home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp: In function ‘int cpu_ctc(THTensor*, THTensor*, THTensor*, THTensor*, THTensor*, int, THTensor*)’:
/home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:25:29: error: invalid use of incomplete type ‘THTensor {aka struct THTensor}’
     float *probs_ptr = probs->storage->data + probs->storageOffset;
                             ^
In file included from generic/THTensor.h:1:0,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THGenerateFloatTypes.h:10,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THGenerateAllTypes.h:10,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THTensor.h:11,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THCTensor.h:4,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THC.h:13,
                 from /home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:9:
/home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/generic/THTensor.h:10:16: error: forward declaration of ‘THTensor {aka struct THTensor}’
 typedef struct THTensor THTensor;
                ^
/home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:25:52: error: invalid use of incomplete type ‘THTensor {aka struct THTensor}’
     float *probs_ptr = probs->storage->data + probs->storageOffset;
                                                    ^
In file included from generic/THTensor.h:1:0,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THGenerateFloatTypes.h:10,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THGenerateAllTypes.h:10,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THTensor.h:11,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THCTensor.h:4,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THC.h:13,
                 from /home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:9:
/home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/generic/THTensor.h:10:16: error: forward declaration of ‘THTensor {aka struct THTensor}’
 typedef struct THTensor THTensor;
                ^
/home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:27:14: error: invalid use of incomplete type ‘THTensor {aka struct THTensor}’
     if (grads->storage) {
              ^
In file included from generic/THTensor.h:1:0,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THGenerateFloatTypes.h:10,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THGenerateAllTypes.h:10,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THTensor.h:11,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THCTensor.h:4,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THC.h:13,
                 from /home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:9:
/home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/generic/THTensor.h:10:16: error: forward declaration of ‘THTensor {aka struct THTensor}’
 typedef struct THTensor THTensor;
                ^
/home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:28:30: error: invalid use of incomplete type ‘THTensor {aka struct THTensor}’
             grads_ptr = grads->storage->data + grads->storageOffset;
                              ^
In file included from generic/THTensor.h:1:0,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THGenerateFloatTypes.h:10,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THGenerateAllTypes.h:10,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THTensor.h:11,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THCTensor.h:4,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THC.h:13,
                 from /home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:9:
/home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/generic/THTensor.h:10:16: error: forward declaration of ‘THTensor {aka struct THTensor}’
 typedef struct THTensor THTensor;
                ^
/home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:28:53: error: invalid use of incomplete type ‘THTensor {aka struct THTensor}’
             grads_ptr = grads->storage->data + grads->storageOffset;
                                                     ^
In file included from generic/THTensor.h:1:0,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THGenerateFloatTypes.h:10,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THGenerateAllTypes.h:10,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THTensor.h:11,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THCTensor.h:4,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THC.h:13,
                 from /home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:9:
/home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/generic/THTensor.h:10:16: error: forward declaration of ‘THTensor {aka struct THTensor}’
 typedef struct THTensor THTensor;
                ^
/home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:33:27: error: invalid use of incomplete type ‘THTensor {aka struct THTensor}’
     int *sizes_ptr = sizes->storage->data + sizes->storageOffset;
                           ^
In file included from generic/THTensor.h:1:0,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THGenerateFloatTypes.h:10,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THGenerateAllTypes.h:10,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THTensor.h:11,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THCTensor.h:4,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THC.h:13,
                 from /home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:9:
/home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/generic/THTensor.h:10:16: error: forward declaration of ‘THTensor {aka struct THTensor}’
 typedef struct THTensor THTensor;
                ^
/home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:33:50: error: invalid use of incomplete type ‘THTensor {aka struct THTensor}’
     int *sizes_ptr = sizes->storage->data + sizes->storageOffset;
                                                  ^
In file included from generic/THTensor.h:1:0,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THGenerateFloatTypes.h:10,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THGenerateAllTypes.h:10,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THTensor.h:11,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THCTensor.h:4,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THC.h:13,
                 from /home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:9:
/home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/generic/THTensor.h:10:16: error: forward declaration of ‘THTensor {aka struct THTensor}’
 typedef struct THTensor THTensor;
                ^
/home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:34:29: error: invalid use of incomplete type ‘THTensor {aka struct THTensor}’
     int *labels_ptr = labels->storage->data + labels->storageOffset;
                             ^
In file included from generic/THTensor.h:1:0,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THGenerateFloatTypes.h:10,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THGenerateAllTypes.h:10,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THTensor.h:11,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THCTensor.h:4,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THC.h:13,
                 from /home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:9:
/home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/generic/THTensor.h:10:16: error: forward declaration of ‘THTensor {aka struct THTensor}’
 typedef struct THTensor THTensor;
                ^
/home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:34:53: error: invalid use of incomplete type ‘THTensor {aka struct THTensor}’
     int *labels_ptr = labels->storage->data + labels->storageOffset;
                                                     ^
In file included from generic/THTensor.h:1:0,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THGenerateFloatTypes.h:10,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THGenerateAllTypes.h:10,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THTensor.h:11,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THCTensor.h:4,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THC.h:13,
                 from /home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:9:
/home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/generic/THTensor.h:10:16: error: forward declaration of ‘THTensor {aka struct THTensor}’
 typedef struct THTensor THTensor;
                ^
/home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:35:39: error: invalid use of incomplete type ‘THTensor {aka struct THTensor}’
     int *label_sizes_ptr = label_sizes->storage->data + label_sizes->storageOffset;
                                       ^
In file included from generic/THTensor.h:1:0,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THGenerateFloatTypes.h:10,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THGenerateAllTypes.h:10,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THTensor.h:11,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THCTensor.h:4,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THC.h:13,
                 from /home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:9:
/home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/generic/THTensor.h:10:16: error: forward declaration of ‘THTensor {aka struct THTensor}’
 typedef struct THTensor THTensor;
                ^
/home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:35:68: error: invalid use of incomplete type ‘THTensor {aka struct THTensor}’
     int *label_sizes_ptr = label_sizes->storage->data + label_sizes->storageOffset;
                                                                    ^
In file included from generic/THTensor.h:1:0,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THGenerateFloatTypes.h:10,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THGenerateAllTypes.h:10,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THTensor.h:11,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THCTensor.h:4,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THC.h:13,
                 from /home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:9:
/home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/generic/THTensor.h:10:16: error: forward declaration of ‘THTensor {aka struct THTensor}’
 typedef struct THTensor THTensor;
                ^
/home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:36:29: error: invalid use of incomplete type ‘THTensor {aka struct THTensor}’
     float *costs_ptr = costs->storage->data + costs->storageOffset;
                             ^
In file included from generic/THTensor.h:1:0,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THGenerateFloatTypes.h:10,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THGenerateAllTypes.h:10,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THTensor.h:11,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THCTensor.h:4,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THC.h:13,
                 from /home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:9:
/home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/generic/THTensor.h:10:16: error: forward declaration of ‘THTensor {aka struct THTensor}’
 typedef struct THTensor THTensor;
                ^
/home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:36:52: error: invalid use of incomplete type ‘THTensor {aka struct THTensor}’
     float *costs_ptr = costs->storage->data + costs->storageOffset;
                                                    ^
In file included from generic/THTensor.h:1:0,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THGenerateFloatTypes.h:10,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THGenerateAllTypes.h:10,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THTensor.h:11,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THCTensor.h:4,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THC.h:13,
                 from /home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:9:
/home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/generic/THTensor.h:10:16: error: forward declaration of ‘THTensor {aka struct THTensor}’
 typedef struct THTensor THTensor;
                ^
/home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:50:35: error: invalid use of incomplete type ‘THTensor {aka struct THTensor}’
                        (int) probs->size[2], minibatch_size,
                                   ^
In file included from generic/THTensor.h:1:0,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THGenerateFloatTypes.h:10,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THGenerateAllTypes.h:10,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THTensor.h:11,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THCTensor.h:4,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THC.h:13,
                 from /home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:9:
/home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/generic/THTensor.h:10:16: error: forward declaration of ‘THTensor {aka struct THTensor}’
 typedef struct THTensor THTensor;
                ^
/home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:57:38: error: invalid use of incomplete type ‘THTensor {aka struct THTensor}’
                      sizes_ptr, probs->size[2],
                                      ^
In file included from generic/THTensor.h:1:0,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THGenerateFloatTypes.h:10,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THGenerateAllTypes.h:10,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THTensor.h:11,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THCTensor.h:4,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THC.h:13,
                 from /home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:9:
/home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/generic/THTensor.h:10:16: error: forward declaration of ‘THTensor {aka struct THTensor}’
 typedef struct THTensor THTensor;
                ^
/home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp: In function ‘int gpu_ctc(THCTensor*, THCTensor*, THTensor*, THTensor*, THTensor*, int, THTensor*)’:
/home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:73:32: error: invalid use of incomplete type ‘THCTensor {aka struct THCTensor}’
        float *probs_ptr = probs->storage->data + probs->storageOffset;
                                ^
In file included from generic/THCTensor.h:1:0,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THCGenerateAllTypes.h:17,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THCTensor.h:18,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THC.h:13,
                 from /home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:9:
/home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/generic/THCTensor.h:7:16: error: forward declaration of ‘THCTensor {aka struct THCTensor}’
 typedef struct THCTensor THCTensor;
                ^
/home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:73:55: error: invalid use of incomplete type ‘THCTensor {aka struct THCTensor}’
        float *probs_ptr = probs->storage->data + probs->storageOffset;
                                                       ^
In file included from generic/THCTensor.h:1:0,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THCGenerateAllTypes.h:17,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THCTensor.h:18,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THC.h:13,
                 from /home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:9:
/home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/generic/THCTensor.h:7:16: error: forward declaration of ‘THCTensor {aka struct THCTensor}’
 typedef struct THCTensor THCTensor;
                ^
/home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:75:17: error: invalid use of incomplete type ‘THCTensor {aka struct THCTensor}’
        if (grads->storage) {
                 ^
In file included from generic/THCTensor.h:1:0,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THCGenerateAllTypes.h:17,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THCTensor.h:18,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THC.h:13,
                 from /home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:9:
/home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/generic/THCTensor.h:7:16: error: forward declaration of ‘THCTensor {aka struct THCTensor}’
 typedef struct THCTensor THCTensor;
                ^
/home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:76:33: error: invalid use of incomplete type ‘THCTensor {aka struct THCTensor}’
                grads_ptr = grads->storage->data + grads->storageOffset;
                                 ^
In file included from generic/THCTensor.h:1:0,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THCGenerateAllTypes.h:17,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THCTensor.h:18,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THC.h:13,
                 from /home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:9:
/home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/generic/THCTensor.h:7:16: error: forward declaration of ‘THCTensor {aka struct THCTensor}’
 typedef struct THCTensor THCTensor;
                ^
/home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:76:56: error: invalid use of incomplete type ‘THCTensor {aka struct THCTensor}’
                grads_ptr = grads->storage->data + grads->storageOffset;
                                                        ^
In file included from generic/THCTensor.h:1:0,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THCGenerateAllTypes.h:17,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THCTensor.h:18,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THC.h:13,
                 from /home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:9:
/home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/generic/THCTensor.h:7:16: error: forward declaration of ‘THCTensor {aka struct THCTensor}’
 typedef struct THCTensor THCTensor;
                ^
/home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:81:30: error: invalid use of incomplete type ‘THTensor {aka struct THTensor}’
        int *sizes_ptr = sizes->storage->data + sizes->storageOffset;
                              ^
In file included from generic/THTensor.h:1:0,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THGenerateFloatTypes.h:10,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THGenerateAllTypes.h:10,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THTensor.h:11,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THCTensor.h:4,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THC.h:13,
                 from /home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:9:
/home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/generic/THTensor.h:10:16: error: forward declaration of ‘THTensor {aka struct THTensor}’
 typedef struct THTensor THTensor;
                ^
/home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:81:53: error: invalid use of incomplete type ‘THTensor {aka struct THTensor}’
        int *sizes_ptr = sizes->storage->data + sizes->storageOffset;
                                                     ^
In file included from generic/THTensor.h:1:0,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THGenerateFloatTypes.h:10,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THGenerateAllTypes.h:10,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THTensor.h:11,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THCTensor.h:4,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THC.h:13,
                 from /home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:9:
/home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/generic/THTensor.h:10:16: error: forward declaration of ‘THTensor {aka struct THTensor}’
 typedef struct THTensor THTensor;
                ^
/home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:82:32: error: invalid use of incomplete type ‘THTensor {aka struct THTensor}’
        int *labels_ptr = labels->storage->data + labels->storageOffset;
                                ^
In file included from generic/THTensor.h:1:0,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THGenerateFloatTypes.h:10,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THGenerateAllTypes.h:10,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THTensor.h:11,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THCTensor.h:4,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THC.h:13,
                 from /home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:9:
/home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/generic/THTensor.h:10:16: error: forward declaration of ‘THTensor {aka struct THTensor}’
 typedef struct THTensor THTensor;
                ^
/home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:82:56: error: invalid use of incomplete type ‘THTensor {aka struct THTensor}’
        int *labels_ptr = labels->storage->data + labels->storageOffset;
                                                        ^
In file included from generic/THTensor.h:1:0,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THGenerateFloatTypes.h:10,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THGenerateAllTypes.h:10,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THTensor.h:11,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THCTensor.h:4,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THC.h:13,
                 from /home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:9:
/home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/generic/THTensor.h:10:16: error: forward declaration of ‘THTensor {aka struct THTensor}’
 typedef struct THTensor THTensor;
                ^
/home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:83:42: error: invalid use of incomplete type ‘THTensor {aka struct THTensor}’
        int *label_sizes_ptr = label_sizes->storage->data + label_sizes->storageOffset;
                                          ^
In file included from generic/THTensor.h:1:0,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THGenerateFloatTypes.h:10,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THGenerateAllTypes.h:10,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THTensor.h:11,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THCTensor.h:4,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THC.h:13,
                 from /home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:9:
/home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/generic/THTensor.h:10:16: error: forward declaration of ‘THTensor {aka struct THTensor}’
 typedef struct THTensor THTensor;
                ^
/home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:83:71: error: invalid use of incomplete type ‘THTensor {aka struct THTensor}’
        int *label_sizes_ptr = label_sizes->storage->data + label_sizes->storageOffset;
                                                                       ^
In file included from generic/THTensor.h:1:0,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THGenerateFloatTypes.h:10,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THGenerateAllTypes.h:10,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THTensor.h:11,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THCTensor.h:4,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THC.h:13,
                 from /home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:9:
/home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/generic/THTensor.h:10:16: error: forward declaration of ‘THTensor {aka struct THTensor}’
 typedef struct THTensor THTensor;
                ^
/home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:84:32: error: invalid use of incomplete type ‘THTensor {aka struct THTensor}’
        float *costs_ptr = costs->storage->data + costs->storageOffset;
                                ^
In file included from generic/THTensor.h:1:0,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THGenerateFloatTypes.h:10,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THGenerateAllTypes.h:10,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THTensor.h:11,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THCTensor.h:4,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THC.h:13,
                 from /home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:9:
/home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/generic/THTensor.h:10:16: error: forward declaration of ‘THTensor {aka struct THTensor}’
 typedef struct THTensor THTensor;
                ^
/home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:84:55: error: invalid use of incomplete type ‘THTensor {aka struct THTensor}’
        float *costs_ptr = costs->storage->data + costs->storageOffset;
                                                       ^
In file included from generic/THTensor.h:1:0,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THGenerateFloatTypes.h:10,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THGenerateAllTypes.h:10,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THTensor.h:11,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THCTensor.h:4,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THC.h:13,
                 from /home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:9:
/home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/generic/THTensor.h:10:16: error: forward declaration of ‘THTensor {aka struct THTensor}’
 typedef struct THTensor THTensor;
                ^
/home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:93:38: error: invalid use of incomplete type ‘THCTensor {aka struct THCTensor}’
                           (int) probs->size[2], minibatch_size,
                                      ^
In file included from generic/THCTensor.h:1:0,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THCGenerateAllTypes.h:17,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THCTensor.h:18,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THC.h:13,
                 from /home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:9:
/home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/generic/THCTensor.h:7:16: error: forward declaration of ‘THCTensor {aka struct THCTensor}’
 typedef struct THCTensor THCTensor;
                ^
/home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:101:41: error: invalid use of incomplete type ‘THCTensor {aka struct THCTensor}’
                         sizes_ptr, probs->size[2],
                                         ^
In file included from generic/THCTensor.h:1:0,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THCGenerateAllTypes.h:17,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THCTensor.h:18,
                 from /home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THC.h:13,
                 from /home/jbaik/setup/pytorch/sn.warp-ctc/pytorch_binding/src/binding.cpp:9:
/home/jbaik/.pyenv/versions/3.6.5/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/generic/THCTensor.h:7:16: error: forward declaration of ‘THCTensor {aka struct THCTensor}’
 typedef struct THCTensor THCTensor;
                ^
error: command 'gcc' failed with exit status 1

Can I get some help for this? Thank you!

segmentation fault while running python setup.py install

make worked with out errors but setup.py install ended up with seg fault
pytorch version :0.4
cuda :9.0
can any one help me

/home/chaitusvk/Documents/warp-ctc/src/reduce.cu(44): warning: function "__shfl_down(float, unsigned int, int)"
/usr/local/cuda-9.0/include/sm_30_intrinsics.hpp(278): here was declared deprecated ("__shfl_down() is not valid on compute_70 and above, and should be replaced with __shfl_down_sync().To continue using __shfl_down(), specify virtual architecture compute_60 when targeting sm_70 and above, for example, using the pair of compiler options: -arch=compute_60 -code=sm_70.")
detected during:
instantiation of "T CTAReduce<NT, T, Rop>::reduce(int, T, CTAReduce<NT, T, Rop>::Storage &, int, Rop) [with NT=128, T=float, Rop=ctc_helper::add<float, float>]"
(76): here
instantiation of "void reduce_rows<NT,Iop,Rop,T>(Iop, Rop, const T *, T *, int, int) [with NT=128, Iop=ctc_helper::negate<float, float>, Rop=ctc_helper::add<float, float>, T=float]"
(124): here
instantiation of "void ReduceHelper::impl(Iof, Rof, const T *, T *, int, int, __nv_bool, cudaStream_t) [with T=float, Iof=ctc_helper::negate<float, float>, Rof=ctc_helper::add<float, float>]"
(139): here
instantiation of "ctcStatus_t reduce(Iof, Rof, const T *, T *, int, int, __nv_bool, cudaStream_t) [with T=float, Iof=ctc_helper::negate<float, float>, Rof=ctc_helper::add<float, float>]"
(149): here

/home/chaitusvk/Documents/warp-ctc/src/reduce.cu(44): warning: function "__shfl_down(float, unsigned int, int)"
/usr/local/cuda-9.0/include/sm_30_intrinsics.hpp(278): here was declared deprecated ("__shfl_down() is not valid on compute_70 and above, and should be replaced with __shfl_down_sync().To continue using __shfl_down(), specify virtual architecture compute_60 when targeting sm_70 and above, for example, using the pair of compiler options: -arch=compute_60 -code=sm_70.")
detected during:
instantiation of "T CTAReduce<NT, T, Rop>::reduce(int, T, CTAReduce<NT, T, Rop>::Storage &, int, Rop) [with NT=128, T=float, Rop=ctc_helper::maximum<float, float>]"
(76): here
instantiation of "void reduce_rows<NT,Iop,Rop,T>(Iop, Rop, const T *, T *, int, int) [with NT=128, Iop=ctc_helper::identity<float, float>, Rop=ctc_helper::maximum<float, float>, T=float]"
(124): here
instantiation of "void ReduceHelper::impl(Iof, Rof, const T *, T *, int, int, __nv_bool, cudaStream_t) [with T=float, Iof=ctc_helper::identity<float, float>, Rof=ctc_helper::maximum<float, float>]"
(139): here
instantiation of "ctcStatus_t reduce(Iof, Rof, const T *, T *, int, int, __nv_bool, cudaStream_t) [with T=float, Iof=ctc_helper::identity<float, float>, Rof=ctc_helper::maximum<float, float>]"
(157): here

/home/chaitusvk/Documents/warp-ctc/src/reduce.cu(44): warning: function "__shfl_down(float, unsigned int, int)"
/usr/local/cuda-9.0/include/sm_30_intrinsics.hpp(278): here was declared deprecated ("__shfl_down() is deprecated in favor of __shfl_down_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to suppress this warning).")
detected during:
instantiation of "T CTAReduce<NT, T, Rop>::reduce(int, T, CTAReduce<NT, T, Rop>::Storage &, int, Rop) [with NT=128, T=float, Rop=ctc_helper::add<float, float>]"
(76): here
instantiation of "void reduce_rows<NT,Iop,Rop,T>(Iop, Rop, const T *, T *, int, int) [with NT=128, Iop=ctc_helper::negate<float, float>, Rop=ctc_helper::add<float, float>, T=float]"
(124): here
instantiation of "void ReduceHelper::impl(Iof, Rof, const T *, T *, int, int, __nv_bool, cudaStream_t) [with T=float, Iof=ctc_helper::negate<float, float>, Rof=ctc_helper::add<float, float>]"
(139): here
instantiation of "ctcStatus_t reduce(Iof, Rof, const T *, T *, int, int, __nv_bool, cudaStream_t) [with T=float, Iof=ctc_helper::negate<float, float>, Rof=ctc_helper::add<float, float>]"
(149): here

/home/chaitusvk/Documents/warp-ctc/src/reduce.cu(44): warning: function "__shfl_down(float, unsigned int, int)"
/usr/local/cuda-9.0/include/sm_30_intrinsics.hpp(278): here was declared deprecated ("__shfl_down() is deprecated in favor of __shfl_down_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to suppress this warning).")
detected during:
instantiation of "T CTAReduce<NT, T, Rop>::reduce(int, T, CTAReduce<NT, T, Rop>::Storage &, int, Rop) [with NT=128, T=float, Rop=ctc_helper::maximum<float, float>]"
(76): here
instantiation of "void reduce_rows<NT,Iop,Rop,T>(Iop, Rop, const T *, T *, int, int) [with NT=128, Iop=ctc_helper::identity<float, float>, Rop=ctc_helper::maximum<float, float>, T=float]"
(124): here
instantiation of "void ReduceHelper::impl(Iof, Rof, const T *, T *, int, int, __nv_bool, cudaStream_t) [with T=float, Iof=ctc_helper::identity<float, float>, Rof=ctc_helper::maximum<float, float>]"
(139): here
instantiation of "ctcStatus_t reduce(Iof, Rof, const T *, T *, int, int, __nv_bool, cudaStream_t) [with T=float, Iof=ctc_helper::identity<float, float>, Rof=ctc_helper::maximum<float, float>]"
(157): here

/home/chaitusvk/Documents/warp-ctc/src/reduce.cu(44): warning: function "__shfl_down(float, unsigned int, int)"
/usr/local/cuda-9.0/include/sm_30_intrinsics.hpp(278): here was declared deprecated ("__shfl_down() is deprecated in favor of __shfl_down_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to suppress this warning).")
detected during:
instantiation of "T CTAReduce<NT, T, Rop>::reduce(int, T, CTAReduce<NT, T, Rop>::Storage &, int, Rop) [with NT=128, T=float, Rop=ctc_helper::add<float, float>]"
(76): here
instantiation of "void reduce_rows<NT,Iop,Rop,T>(Iop, Rop, const T *, T *, int, int) [with NT=128, Iop=ctc_helper::negate<float, float>, Rop=ctc_helper::add<float, float>, T=float]"
(124): here
instantiation of "void ReduceHelper::impl(Iof, Rof, const T *, T *, int, int, __nv_bool, cudaStream_t) [with T=float, Iof=ctc_helper::negate<float, float>, Rof=ctc_helper::add<float, float>]"
(139): here
instantiation of "ctcStatus_t reduce(Iof, Rof, const T *, T *, int, int, __nv_bool, cudaStream_t) [with T=float, Iof=ctc_helper::negate<float, float>, Rof=ctc_helper::add<float, float>]"
(149): here

/home/chaitusvk/Documents/warp-ctc/src/reduce.cu(44): warning: function "__shfl_down(float, unsigned int, int)"
/usr/local/cuda-9.0/include/sm_30_intrinsics.hpp(278): here was declared deprecated ("__shfl_down() is deprecated in favor of __shfl_down_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to suppress this warning).")
detected during:
instantiation of "T CTAReduce<NT, T, Rop>::reduce(int, T, CTAReduce<NT, T, Rop>::Storage &, int, Rop) [with NT=128, T=float, Rop=ctc_helper::maximum<float, float>]"
(76): here
instantiation of "void reduce_rows<NT,Iop,Rop,T>(Iop, Rop, const T *, T *, int, int) [with NT=128, Iop=ctc_helper::identity<float, float>, Rop=ctc_helper::maximum<float, float>, T=float]"
(124): here
instantiation of "void ReduceHelper::impl(Iof, Rof, const T *, T *, int, int, __nv_bool, cudaStream_t) [with T=float, Iof=ctc_helper::identity<float, float>, Rof=ctc_helper::maximum<float, float>]"
(139): here
instantiation of "ctcStatus_t reduce(Iof, Rof, const T *, T *, int, int, __nv_bool, cudaStream_t) [with T=float, Iof=ctc_helper::identity<float, float>, Rof=ctc_helper::maximum<float, float>]"
(157): here

/home/chaitusvk/Documents/warp-ctc/src/reduce.cu(44): warning: function "__shfl_down(float, unsigned int, int)"
/usr/local/cuda-9.0/include/sm_30_intrinsics.hpp(278): here was declared deprecated ("__shfl_down() is deprecated in favor of __shfl_down_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to suppress this warning).")
detected during:
instantiation of "T CTAReduce<NT, T, Rop>::reduce(int, T, CTAReduce<NT, T, Rop>::Storage &, int, Rop) [with NT=128, T=float, Rop=ctc_helper::add<float, float>]"
(76): here
instantiation of "void reduce_rows<NT,Iop,Rop,T>(Iop, Rop, const T *, T *, int, int) [with NT=128, Iop=ctc_helper::negate<float, float>, Rop=ctc_helper::add<float, float>, T=float]"
(124): here
instantiation of "void ReduceHelper::impl(Iof, Rof, const T *, T *, int, int, __nv_bool, cudaStream_t) [with T=float, Iof=ctc_helper::negate<float, float>, Rof=ctc_helper::add<float, float>]"
(139): here
instantiation of "ctcStatus_t reduce(Iof, Rof, const T *, T *, int, int, __nv_bool, cudaStream_t) [with T=float, Iof=ctc_helper::negate<float, float>, Rof=ctc_helper::add<float, float>]"
(149): here

/home/chaitusvk/Documents/warp-ctc/src/reduce.cu(44): warning: function "__shfl_down(float, unsigned int, int)"
/usr/local/cuda-9.0/include/sm_30_intrinsics.hpp(278): here was declared deprecated ("__shfl_down() is deprecated in favor of __shfl_down_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to suppress this warning).")
detected during:
instantiation of "T CTAReduce<NT, T, Rop>::reduce(int, T, CTAReduce<NT, T, Rop>::Storage &, int, Rop) [with NT=128, T=float, Rop=ctc_helper::maximum<float, float>]"
(76): here
instantiation of "void reduce_rows<NT,Iop,Rop,T>(Iop, Rop, const T *, T *, int, int) [with NT=128, Iop=ctc_helper::identity<float, float>, Rop=ctc_helper::maximum<float, float>, T=float]"
(124): here
instantiation of "void ReduceHelper::impl(Iof, Rof, const T *, T *, int, int, __nv_bool, cudaStream_t) [with T=float, Iof=ctc_helper::identity<float, float>, Rof=ctc_helper::maximum<float, float>]"
(139): here
instantiation of "ctcStatus_t reduce(Iof, Rof, const T *, T *, int, int, __nv_bool, cudaStream_t) [with T=float, Iof=ctc_helper::identity<float, float>, Rof=ctc_helper::maximum<float, float>]"
(157): here

/home/chaitusvk/Documents/warp-ctc/src/reduce.cu(44): warning: function "__shfl_down(float, unsigned int, int)"
/usr/local/cuda-9.0/include/sm_30_intrinsics.hpp(278): here was declared deprecated ("__shfl_down() is deprecated in favor of __shfl_down_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to suppress this warning).")
detected during:
instantiation of "T CTAReduce<NT, T, Rop>::reduce(int, T, CTAReduce<NT, T, Rop>::Storage &, int, Rop) [with NT=128, T=float, Rop=ctc_helper::add<float, float>]"
(76): here
instantiation of "void reduce_rows<NT,Iop,Rop,T>(Iop, Rop, const T *, T *, int, int) [with NT=128, Iop=ctc_helper::negate<float, float>, Rop=ctc_helper::add<float, float>, T=float]"
(124): here
instantiation of "void ReduceHelper::impl(Iof, Rof, const T *, T *, int, int, __nv_bool, cudaStream_t) [with T=float, Iof=ctc_helper::negate<float, float>, Rof=ctc_helper::add<float, float>]"
(139): here
instantiation of "ctcStatus_t reduce(Iof, Rof, const T *, T *, int, int, __nv_bool, cudaStream_t) [with T=float, Iof=ctc_helper::negate<float, float>, Rof=ctc_helper::add<float, float>]"
(149): here

/home/chaitusvk/Documents/warp-ctc/src/reduce.cu(44): warning: function "__shfl_down(float, unsigned int, int)"
/usr/local/cuda-9.0/include/sm_30_intrinsics.hpp(278): here was declared deprecated ("__shfl_down() is deprecated in favor of __shfl_down_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to suppress this warning).")
detected during:
instantiation of "T CTAReduce<NT, T, Rop>::reduce(int, T, CTAReduce<NT, T, Rop>::Storage &, int, Rop) [with NT=128, T=float, Rop=ctc_helper::maximum<float, float>]"
(76): here
instantiation of "void reduce_rows<NT,Iop,Rop,T>(Iop, Rop, const T *, T *, int, int) [with NT=128, Iop=ctc_helper::identity<float, float>, Rop=ctc_helper::maximum<float, float>, T=float]"
(124): here
instantiation of "void ReduceHelper::impl(Iof, Rof, const T *, T *, int, int, __nv_bool, cudaStream_t) [with T=float, Iof=ctc_helper::identity<float, float>, Rof=ctc_helper::maximum<float, float>]"
(139): here
instantiation of "ctcStatus_t reduce(Iof, Rof, const T *, T *, int, int, __nv_bool, cudaStream_t) [with T=float, Iof=ctc_helper::identity<float, float>, Rof=ctc_helper::maximum<float, float>]"
(157): here

/home/chaitusvk/Documents/warp-ctc/src/reduce.cu(44): warning: function "__shfl_down(float, unsigned int, int)"
/usr/local/cuda-9.0/include/sm_30_intrinsics.hpp(278): here was declared deprecated ("__shfl_down() is deprecated in favor of __shfl_down_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to suppress this warning).")
detected during:
instantiation of "T CTAReduce<NT, T, Rop>::reduce(int, T, CTAReduce<NT, T, Rop>::Storage &, int, Rop) [with NT=128, T=float, Rop=ctc_helper::add<float, float>]"
(76): here
instantiation of "void reduce_rows<NT,Iop,Rop,T>(Iop, Rop, const T *, T *, int, int) [with NT=128, Iop=ctc_helper::negate<float, float>, Rop=ctc_helper::add<float, float>, T=float]"
(124): here
instantiation of "void ReduceHelper::impl(Iof, Rof, const T *, T *, int, int, __nv_bool, cudaStream_t) [with T=float, Iof=ctc_helper::negate<float, float>, Rof=ctc_helper::add<float, float>]"
(139): here
instantiation of "ctcStatus_t reduce(Iof, Rof, const T *, T *, int, int, __nv_bool, cudaStream_t) [with T=float, Iof=ctc_helper::negate<float, float>, Rof=ctc_helper::add<float, float>]"
(149): here

/home/chaitusvk/Documents/warp-ctc/src/reduce.cu(44): warning: function "__shfl_down(float, unsigned int, int)"
/usr/local/cuda-9.0/include/sm_30_intrinsics.hpp(278): here was declared deprecated ("__shfl_down() is deprecated in favor of __shfl_down_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to suppress this warning).")
detected during:
instantiation of "T CTAReduce<NT, T, Rop>::reduce(int, T, CTAReduce<NT, T, Rop>::Storage &, int, Rop) [with NT=128, T=float, Rop=ctc_helper::maximum<float, float>]"
(76): here
instantiation of "void reduce_rows<NT,Iop,Rop,T>(Iop, Rop, const T *, T *, int, int) [with NT=128, Iop=ctc_helper::identity<float, float>, Rop=ctc_helper::maximum<float, float>, T=float]"
(124): here
instantiation of "void ReduceHelper::impl(Iof, Rof, const T *, T *, int, int, __nv_bool, cudaStream_t) [with T=float, Iof=ctc_helper::identity<float, float>, Rof=ctc_helper::maximum<float, float>]"
(139): here
instantiation of "ctcStatus_t reduce(Iof, Rof, const T *, T *, int, int, __nv_bool, cudaStream_t) [with T=float, Iof=ctc_helper::identity<float, float>, Rof=ctc_helper::maximum<float, float>]"
(157): here

/home/chaitusvk/Documents/warp-ctc/src/reduce.cu(44): warning: function "__shfl_down(float, unsigned int, int)"
/usr/local/cuda-9.0/include/sm_30_intrinsics.hpp(278): here was declared deprecated ("__shfl_down() is deprecated in favor of __shfl_down_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to suppress this warning).")
detected during:
instantiation of "T CTAReduce<NT, T, Rop>::reduce(int, T, CTAReduce<NT, T, Rop>::Storage &, int, Rop) [with NT=128, T=float, Rop=ctc_helper::add<float, float>]"
(76): here
instantiation of "void reduce_rows<NT,Iop,Rop,T>(Iop, Rop, const T *, T *, int, int) [with NT=128, Iop=ctc_helper::negate<float, float>, Rop=ctc_helper::add<float, float>, T=float]"
(124): here
instantiation of "void ReduceHelper::impl(Iof, Rof, const T *, T *, int, int, __nv_bool, cudaStream_t) [with T=float, Iof=ctc_helper::negate<float, float>, Rof=ctc_helper::add<float, float>]"
(139): here
instantiation of "ctcStatus_t reduce(Iof, Rof, const T *, T *, int, int, __nv_bool, cudaStream_t) [with T=float, Iof=ctc_helper::negate<float, float>, Rof=ctc_helper::add<float, float>]"
(149): here

/home/chaitusvk/Documents/warp-ctc/src/reduce.cu(44): warning: function "__shfl_down(float, unsigned int, int)"
/usr/local/cuda-9.0/include/sm_30_intrinsics.hpp(278): here was declared deprecated ("__shfl_down() is deprecated in favor of __shfl_down_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to suppress this warning).")
detected during:
instantiation of "T CTAReduce<NT, T, Rop>::reduce(int, T, CTAReduce<NT, T, Rop>::Storage &, int, Rop) [with NT=128, T=float, Rop=ctc_helper::maximum<float, float>]"
(76): here
instantiation of "void reduce_rows<NT,Iop,Rop,T>(Iop, Rop, const T *, T *, int, int) [with NT=128, Iop=ctc_helper::identity<float, float>, Rop=ctc_helper::maximum<float, float>, T=float]"
(124): here
instantiation of "void ReduceHelper::impl(Iof, Rof, const T *, T *, int, int, __nv_bool, cudaStream_t) [with T=float, Iof=ctc_helper::identity<float, float>, Rof=ctc_helper::maximum<float, float>]"
(139): here
instantiation of "ctcStatus_t reduce(Iof, Rof, const T *, T *, int, int, __nv_bool, cudaStream_t) [with T=float, Iof=ctc_helper::identity<float, float>, Rof=ctc_helper::maximum<float, float>]"
(157): here

/home/chaitusvk/Documents/warp-ctc/src/reduce.cu(44): warning: function "__shfl_down(float, unsigned int, int)"
/usr/local/cuda-9.0/include/sm_30_intrinsics.hpp(278): here was declared deprecated ("__shfl_down() is deprecated in favor of __shfl_down_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to suppress this warning).")
detected during:
instantiation of "T CTAReduce<NT, T, Rop>::reduce(int, T, CTAReduce<NT, T, Rop>::Storage &, int, Rop) [with NT=128, T=float, Rop=ctc_helper::add<float, float>]"
(76): here
instantiation of "void reduce_rows<NT,Iop,Rop,T>(Iop, Rop, const T *, T *, int, int) [with NT=128, Iop=ctc_helper::negate<float, float>, Rop=ctc_helper::add<float, float>, T=float]"
(124): here
instantiation of "void ReduceHelper::impl(Iof, Rof, const T *, T *, int, int, __nv_bool, cudaStream_t) [with T=float, Iof=ctc_helper::negate<float, float>, Rof=ctc_helper::add<float, float>]"
(139): here
instantiation of "ctcStatus_t reduce(Iof, Rof, const T *, T *, int, int, __nv_bool, cudaStream_t) [with T=float, Iof=ctc_helper::negate<float, float>, Rof=ctc_helper::add<float, float>]"
(149): here

/home/chaitusvk/Documents/warp-ctc/src/reduce.cu(44): warning: function "__shfl_down(float, unsigned int, int)"
/usr/local/cuda-9.0/include/sm_30_intrinsics.hpp(278): here was declared deprecated ("__shfl_down() is deprecated in favor of __shfl_down_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to suppress this warning).")
detected during:
instantiation of "T CTAReduce<NT, T, Rop>::reduce(int, T, CTAReduce<NT, T, Rop>::Storage &, int, Rop) [with NT=128, T=float, Rop=ctc_helper::maximum<float, float>]"
(76): here
instantiation of "void reduce_rows<NT,Iop,Rop,T>(Iop, Rop, const T *, T *, int, int) [with NT=128, Iop=ctc_helper::identity<float, float>, Rop=ctc_helper::maximum<float, float>, T=float]"
(124): here
instantiation of "void ReduceHelper::impl(Iof, Rof, const T *, T *, int, int, __nv_bool, cudaStream_t) [with T=float, Iof=ctc_helper::identity<float, float>, Rof=ctc_helper::maximum<float, float>]"
(139): here
instantiation of "ctcStatus_t reduce(Iof, Rof, const T *, T *, int, int, __nv_bool, cudaStream_t) [with T=float, Iof=ctc_helper::identity<float, float>, Rof=ctc_helper::maximum<float, float>]"
(157): here

[ 22%] Building NVCC (Device) object CMakeFiles/warpctc.dir/src/warpctc_generated_ctc_entrypoint.cu.o
/home/chaitusvk/Documents/warp-ctc/include/contrib/moderngpu/include/device/intrinsics.cuh(115): warning: function "__shfl_up(float, unsigned int, int)"
/usr/local/cuda-9.0/include/sm_30_intrinsics.hpp(261): here was declared deprecated ("__shfl_up() is not valid on compute_70 and above, and should be replaced with __shfl_up_sync().To continue using __shfl_up(), specify virtual architecture compute_60 when targeting sm_70 and above, for example, using the pair of compiler options: -arch=compute_60 -code=sm_70.")

/home/chaitusvk/Documents/warp-ctc/include/contrib/moderngpu/include/device/intrinsics.cuh(125): warning: function "__shfl_up(int, unsigned int, int)"
/usr/local/cuda-9.0/include/sm_30_intrinsics.hpp(175): here was declared deprecated ("__shfl_up() is not valid on compute_70 and above, and should be replaced with __shfl_up_sync().To continue using __shfl_up(), specify virtual architecture compute_60 when targeting sm_70 and above, for example, using the pair of compiler options: -arch=compute_60 -code=sm_70.")

/home/chaitusvk/Documents/warp-ctc/include/contrib/moderngpu/include/device/intrinsics.cuh(126): warning: function "__shfl_up(int, unsigned int, int)"
/usr/local/cuda-9.0/include/sm_30_intrinsics.hpp(175): here was declared deprecated ("__shfl_up() is not valid on compute_70 and above, and should be replaced with __shfl_up_sync().To continue using __shfl_up(), specify virtual architecture compute_60 when targeting sm_70 and above, for example, using the pair of compiler options: -arch=compute_60 -code=sm_70.")

/home/chaitusvk/Documents/warp-ctc/include/contrib/moderngpu/include/device/intrinsics.cuh(115): warning: function "__shfl_up(float, unsigned int, int)"
/usr/local/cuda-9.0/include/sm_30_intrinsics.hpp(261): here was declared deprecated ("__shfl_up() is deprecated in favor of __shfl_up_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to suppress this warning).")

/home/chaitusvk/Documents/warp-ctc/include/contrib/moderngpu/include/device/intrinsics.cuh(125): warning: function "__shfl_up(int, unsigned int, int)"
/usr/local/cuda-9.0/include/sm_30_intrinsics.hpp(175): here was declared deprecated ("__shfl_up() is deprecated in favor of __shfl_up_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to suppress this warning).")

/home/chaitusvk/Documents/warp-ctc/include/contrib/moderngpu/include/device/intrinsics.cuh(126): warning: function "__shfl_up(int, unsigned int, int)"
/usr/local/cuda-9.0/include/sm_30_intrinsics.hpp(175): here was declared deprecated ("__shfl_up() is deprecated in favor of __shfl_up_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to suppress this warning).")

/home/chaitusvk/Documents/warp-ctc/include/contrib/moderngpu/include/device/intrinsics.cuh(115): warning: function "__shfl_up(float, unsigned int, int)"
/usr/local/cuda-9.0/include/sm_30_intrinsics.hpp(261): here was declared deprecated ("__shfl_up() is deprecated in favor of __shfl_up_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to suppress this warning).")

/home/chaitusvk/Documents/warp-ctc/include/contrib/moderngpu/include/device/intrinsics.cuh(125): warning: function "__shfl_up(int, unsigned int, int)"
/usr/local/cuda-9.0/include/sm_30_intrinsics.hpp(175): here was declared deprecated ("__shfl_up() is deprecated in favor of __shfl_up_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to suppress this warning).")

/home/chaitusvk/Documents/warp-ctc/include/contrib/moderngpu/include/device/intrinsics.cuh(126): warning: function "__shfl_up(int, unsigned int, int)"
/usr/local/cuda-9.0/include/sm_30_intrinsics.hpp(175): here was declared deprecated ("__shfl_up() is deprecated in favor of __shfl_up_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to suppress this warning).")

/home/chaitusvk/Documents/warp-ctc/include/contrib/moderngpu/include/device/intrinsics.cuh(115): warning: function "__shfl_up(float, unsigned int, int)"
/usr/local/cuda-9.0/include/sm_30_intrinsics.hpp(261): here was declared deprecated ("__shfl_up() is deprecated in favor of __shfl_up_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to suppress this warning).")

/home/chaitusvk/Documents/warp-ctc/include/contrib/moderngpu/include/device/intrinsics.cuh(125): warning: function "__shfl_up(int, unsigned int, int)"
/usr/local/cuda-9.0/include/sm_30_intrinsics.hpp(175): here was declared deprecated ("__shfl_up() is deprecated in favor of __shfl_up_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to suppress this warning).")

/home/chaitusvk/Documents/warp-ctc/include/contrib/moderngpu/include/device/intrinsics.cuh(126): warning: function "__shfl_up(int, unsigned int, int)"
/usr/local/cuda-9.0/include/sm_30_intrinsics.hpp(175): here was declared deprecated ("__shfl_up() is deprecated in favor of __shfl_up_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to suppress this warning).")

/home/chaitusvk/Documents/warp-ctc/include/contrib/moderngpu/include/device/intrinsics.cuh(115): warning: function "__shfl_up(float, unsigned int, int)"
/usr/local/cuda-9.0/include/sm_30_intrinsics.hpp(261): here was declared deprecated ("__shfl_up() is deprecated in favor of __shfl_up_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to suppress this warning).")

/home/chaitusvk/Documents/warp-ctc/include/contrib/moderngpu/include/device/intrinsics.cuh(125): warning: function "__shfl_up(int, unsigned int, int)"
/usr/local/cuda-9.0/include/sm_30_intrinsics.hpp(175): here was declared deprecated ("__shfl_up() is deprecated in favor of __shfl_up_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to suppress this warning).")

/home/chaitusvk/Documents/warp-ctc/include/contrib/moderngpu/include/device/intrinsics.cuh(126): warning: function "__shfl_up(int, unsigned int, int)"
/usr/local/cuda-9.0/include/sm_30_intrinsics.hpp(175): here was declared deprecated ("__shfl_up() is deprecated in favor of __shfl_up_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to suppress this warning).")

/home/chaitusvk/Documents/warp-ctc/include/contrib/moderngpu/include/device/intrinsics.cuh(115): warning: function "__shfl_up(float, unsigned int, int)"
/usr/local/cuda-9.0/include/sm_30_intrinsics.hpp(261): here was declared deprecated ("__shfl_up() is deprecated in favor of __shfl_up_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to suppress this warning).")

/home/chaitusvk/Documents/warp-ctc/include/contrib/moderngpu/include/device/intrinsics.cuh(125): warning: function "__shfl_up(int, unsigned int, int)"
/usr/local/cuda-9.0/include/sm_30_intrinsics.hpp(175): here was declared deprecated ("__shfl_up() is deprecated in favor of __shfl_up_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to suppress this warning).")

/home/chaitusvk/Documents/warp-ctc/include/contrib/moderngpu/include/device/intrinsics.cuh(126): warning: function "__shfl_up(int, unsigned int, int)"
/usr/local/cuda-9.0/include/sm_30_intrinsics.hpp(175): here was declared deprecated ("__shfl_up() is deprecated in favor of __shfl_up_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to suppress this warning).")

/home/chaitusvk/Documents/warp-ctc/include/contrib/moderngpu/include/device/intrinsics.cuh(115): warning: function "__shfl_up(float, unsigned int, int)"
/usr/local/cuda-9.0/include/sm_30_intrinsics.hpp(261): here was declared deprecated ("__shfl_up() is deprecated in favor of __shfl_up_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to suppress this warning).")

/home/chaitusvk/Documents/warp-ctc/include/contrib/moderngpu/include/device/intrinsics.cuh(125): warning: function "__shfl_up(int, unsigned int, int)"
/usr/local/cuda-9.0/include/sm_30_intrinsics.hpp(175): here was declared deprecated ("__shfl_up() is deprecated in favor of __shfl_up_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to suppress this warning).")

/home/chaitusvk/Documents/warp-ctc/include/contrib/moderngpu/include/device/intrinsics.cuh(126): warning: function "__shfl_up(int, unsigned int, int)"
/usr/local/cuda-9.0/include/sm_30_intrinsics.hpp(175): here was declared deprecated ("__shfl_up() is deprecated in favor of __shfl_up_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to suppress this warning).")

/home/chaitusvk/Documents/warp-ctc/include/contrib/moderngpu/include/device/intrinsics.cuh(115): warning: function "__shfl_up(float, unsigned int, int)"
/usr/local/cuda-9.0/include/sm_30_intrinsics.hpp(261): here was declared deprecated ("__shfl_up() is deprecated in favor of __shfl_up_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to suppress this warning).")

/home/chaitusvk/Documents/warp-ctc/include/contrib/moderngpu/include/device/intrinsics.cuh(125): warning: function "__shfl_up(int, unsigned int, int)"
/usr/local/cuda-9.0/include/sm_30_intrinsics.hpp(175): here was declared deprecated ("__shfl_up() is deprecated in favor of __shfl_up_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to suppress this warning).")

/home/chaitusvk/Documents/warp-ctc/include/contrib/moderngpu/include/device/intrinsics.cuh(126): warning: function "__shfl_up(int, unsigned int, int)"
/usr/local/cuda-9.0/include/sm_30_intrinsics.hpp(175): here was declared deprecated ("__shfl_up() is deprecated in favor of __shfl_up_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to suppress this warning).")

[ 33%] Linking CXX shared library libwarpctc.so
[ 33%] Built target warpctc
[ 44%] Building CXX object CMakeFiles/test_cpu.dir/tests/test_cpu.cpp.o
[ 55%] Building CXX object CMakeFiles/test_cpu.dir/tests/random.cpp.o
[ 66%] Linking CXX executable test_cpu
[ 66%] Built target test_cpu
[ 77%] Building NVCC (Device) object CMakeFiles/test_gpu.dir/tests/test_gpu_generated_test_gpu.cu.o
[ 88%] Building CXX object CMakeFiles/test_gpu.dir/tests/random.cpp.o
[100%] Linking CXX executable test_gpu
[100%] Built target test_gpu
chaitusvk@chaitusvk-PC:/Documents/warp-ctc/build$ cd ..
chaitusvk@chaitusvk-PC:
/Documents/warp-ctc$ ls
build CMakeLists.txt doc include LICENSE pytorch_binding README.md src tests
chaitusvk@chaitusvk-PC:/Documents/warp-ctc$ cd pytorch_binding/
chaitusvk@chaitusvk-PC:
/Documents/warp-ctc/pytorch_binding$ ls
build setup.cfg setup.py src tests warpctc_pytorch
chaitusvk@chaitusvk-PC:/Documents/warp-ctc/pytorch_binding$ vi setup.py
chaitusvk@chaitusvk-PC:
/Documents/warp-ctc/pytorch_binding$ sudo python3 setup.py install
Segmentation fault (core dumped)
chaitusvk@chaitusvk-PC:/Documents/warp-ctc/pytorch_binding$ cd ..
chaitusvk@chaitusvk-PC:
/Documents/warp-ctc$ cd build/

problem installing warpctc

/usr/bin/ld: cannot find -lluajit
/usr/bin/ld: cannot find -lTHC
collect2: error: ld returned 1 exit status
CMakeFiles/warpctc.dir/build.make:702: recipe for target 'libwarpctc.so' failed
make[2]: *** [libwarpctc.so] Error 1
CMakeFiles/Makefile2:178: recipe for target 'CMakeFiles/warpctc.dir/all' failed
make[1]: *** [CMakeFiles/warpctc.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

Can not run on gpu

I have some variable saved from crnn-pytorch, which runs on gpu and uses warp-ctc. Then I use those variables in my code, I can run it on cpu and the results are correct. But when I run it on gpu, I got Segmentation fault error.
This is my code which runs on gpu:

import torch
from warpctc_pytorch import CTCLoss
import numpy as np
from torch.autograd import Variable

i = 1
criterion = CTCLoss()
criterion = criterion.cuda()
a = np.load('preds_%d.npy' % i)
b = np.load('text_%d.npy' % i)
c = np.load('preds_size_%d.npy' % i)
d = np.load('length_%d.npy' % i)

#a = Variable(torch.from_numpy(a)).cuda()
#b = Variable(torch.from_numpy(b)).cuda()
#c = Variable(torch.from_numpy(c)).cuda()
#d = Variable(torch.from_numpy(d)).cuda()

a = torch.from_numpy(a).cuda()
b = torch.from_numpy(b).cuda()
c = torch.from_numpy(c).cuda()
d = torch.from_numpy(d).cuda()

print(a.dtype)
print(b.dtype)
print(c.dtype)
print(d.dtype)

cost = criterion(a, b, c, d) / 64
print('cost:', cost)

I got Segmentation fault. When delete all .cuda(), I got correct answer.
All cpu and gpu test has passed.
I really hope someone can help.

If I multiply the CTC loss by a factor, that has no effect on the gradients of probs

Hi,

When I ran the example code in the readme of this repo, I added one line:

cost = 0.1 * cost

Then, I printed out the grad of the probs variable, and compare it with the original code where there is no scaling. But the grads are exactly the same. So why the scaling has no effect?

I did another example with MSELoss that pytorch provided. The scaling did scale the grad there.

I am asking this question because I want to build a weighted sum of ctc loss and some other loss, so the weight needs to be effective for ctc.

My pytorch version is 0.3.1, and ctc was installed from the older repo.

Thank you very much for help.

Building with CUDA 9.0

Hi I'm building warp-ctc with cuda 9
My machine is 17.04 Ubuntu with pytorch installed.
The test_cpu builds ok, but not the test_gpu.

Here is a sample error I get:
home/dlowell/warp-ctc/tests/test_gpu.cu:454:130: required from here /usr/include/c++/6/tuple:483:67: error: mismatched argument pack lengths while expanding ‘std::is_constructible<_Elements, _UElements&&>’ return __and_<is_constructible<_Elements, _UElements&&>...>::value; ^~~~~ /usr/include/c++/6/tuple:484:1: error: body of constexpr function ‘static constexpr bool std::_TC<<anonymous>, _Elements>::_MoveConstructibleTuple() [with _UElements = {std::tuple<int, int, int, int, double>}; bool <anonymous> = true; _Elements = {int, int, int, int, double}]’ not a return-statement }

GCC version:
gcc (Ubuntu 6.3.0-12ubuntu2) 6.3.0 20170406

NVCC:
Cuda compilation tools, release 9.0, V9.0.176

Is this a compiler issue, or a version mismatch?

On another thread I noticed GCC could be an issue. Is this resolved, or should I use 4.8?

Thanks ahead of time for your assistance.

#error -- unsupported GNU version! gcc versions later than 6 are not supported! ^~~~~ CMake Error at warpctc_generated_reduce.cu.o.cmake:219 (message): Error generating /home/rice/warp-ctc/build/CMakeFiles/warpctc.dir/src

when I run main_crnn.py I court this issue:
#error -- unsupported GNU version! gcc versions later than 6 are not supported!
^~~~~
CMake Error at warpctc_generated_reduce.cu.o.cmake:219 (message):
Error generating
/home/rice/warp-ctc/build/CMakeFiles/warpctc.dir/src
uninstall all the cuda ,cudnn,gcc .cmake
reinstall cuda(it contains cudnn,gcc,cmake)

How to return the individual loss of each sequence?

Hi,

Right now the code returns the average or total loss for the entire batch, I am wondering how should I change the source code to return loss for each individual sequence in a batch?

Thank you so much.

Please enable travis

Thank you for the library. We made a class of 200 students use this project for homework and had some reproducible installation issues, although overall it worked out quite well. Also reproducible in a completely clean docker build. Not sure if those are fixed yet, but I'd like to put up an automated build for a sanity check so nothing big breaks in the future.

#12

@SeanNaren can you enable travis so I can try it out? Free CIT is just a few clicks away...

CTC layer producing infinite losses

Hello,
I am trying to train an OCR which takes a binarized image of a sentence from a document image and tries to predict the output. The losses more often than not always become infinite after running for a certain number of epochs.

Epochs:[1]/[25]
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 215/215 [00:07<00:00, 29.54it/s]
train loss (min, avg, max): (-0.276, nan, 1152.610)
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 91/91 [00:01<00:00, 67.98it/s]
validation loss (min, avg, max): (inf, nan, -inf)
Epochs:[2]/[25]
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 215/215 [00:06<00:00, 31.24it/s]
train loss (min, avg, max): (inf, nan, -inf)
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 91/91 [00:01<00:00, 69.84it/s]
validation loss (min, avg, max): (0.000, nan, 0.000)
Epochs:[3]/[25]
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 215/215 [00:06<00:00, 33.08it/s]
train loss (min, avg, max): (1.000, nan, 1.000)
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 91/91 [00:01<00:00, 70.82it/s]
validation loss (min, avg, max): (inf, nan, -inf)

I am not sure where the error is and would be very grateful if some one could point me in the right direction.

Error when calling CTCLoss()

Pytorch 0.4.0a0+408c84d, just rebuilt your fork of warp_ctc from source today.

Feeding some data through an LTSM on GPU, then trying to feed the result to CTC_Loss() as per the documentation.

I can instantiate CTC_Loss() fine, however when I try to call it (line 92 of https://github.com/ZmeiGorynych/basic_pytorch/blob/master/audio_models.py) I get the error

'initializer for ctype \'struct THIntTensor *\' must be a pointer to same type, not cdata \'struct THCudaIntTensor *\''

All the inputs to the call are on the GPU (I double-checked in debugger). The same call completes fine when everything is on the CPU.

Any idea what the matter could be? Thanks a lot!

clang error on python setup.py install

Hi, I have the following error. I am on macOS High Sierra:

clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -I/usr/local/lib/python3.7/site-packages/torch/utils/ffi/../../lib/include -I/usr/local/lib/python3.7/site-packages/torch/utils/ffi/../../lib/include/TH -I/Users/Chandrachud/StillMind/warp-ctc/include -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c /Users/Chandrachud/StillMind/warp-ctc/pytorch_binding/src/binding.cpp -o build/temp.macosx-10.13-x86_64-3.7/Users/Chandrachud/StillMind/warp-ctc/pytorch_binding/src/binding.o -std=c99 -std=c++11 -fPIC -std=c99
error: invalid argument '-std=c99' not allowed with 'C++'
error: command 'clang' failed with exit status 1

I believe the error comes from using clang instead of gcc. I had problems with the previous step of "cmake .." but I solved that by forcing cmake to use gcc by doing:
export CXX=/usr/local/Cellar/gcc/8.2.0/bin/g++-8

How do I make python setup.py install use gcc instead of clang? Or is it some other problem? Thanks

CUDA memory leak with PyTorch 0.4.0

I've just upgraded to PyTorch 0.4.0 (built from source, on v0.4.0 branch), and rebuilt warp-ctc. Now I'm trying to train some CTC based models, and I get steady memory leaks with each batch. The memory leak is GPU memory. The model has 9.5M parameters, and every second the memory usage climbs by about 10MB.
If someone can give me any tips in helping to track it down, I'd be happy to try help.

My configuration:
Ubuntu 16.04, CUDA 9.1, CuDNN 7.1.3, PyTorch v0.4.0 (200fb22b), warp-ctc (1dd0bb1)

cuda92,pytorch 0.4 make error

my server is ubuntu 16.04,torch 0.4
When I execute the make all command,i get the error :

CMakeFiles/test_cpu.dir/tests/test_cpu.cpp.o: In function options_test()': test_cpu.cpp:(.text+0xa12): undefined reference to std::runtime_error::runtime_error(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)'
test_cpu.cpp:(.text+0xb19): undefined reference to std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)' test_cpu.cpp:(.text+0xbff): undefined reference to std::runtime_error::runtime_error(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)'
test_cpu.cpp:(.text+0xd15): undefined reference to std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)' CMakeFiles/test_cpu.dir/tests/test_cpu.cpp.o: In function grad_check(int, int, std::vector<float, std::allocator >&, std::vector<std::vector<int, std::allocator >, std::allocator<std::vector<int, std::allocator > > > const&, std::vector<int, std::allocator > const&)':
test_cpu.cpp:(.text+0x15b7): undefined reference to std::runtime_error::runtime_error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' test_cpu.cpp:(.text+0x1727): undefined reference to std::__cxx11::basic_string<char, std::char_traits, std::allocator >::_M_create(unsigned long&, unsigned long)'
test_cpu.cpp:(.text+0x1804): undefined reference to std::runtime_error::runtime_error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' test_cpu.cpp:(.text+0x1942): undefined reference to std::__cxx11::basic_string<char, std::char_traits, std::allocator >::_M_create(unsigned long&, unsigned long)'
test_cpu.cpp:(.text+0x1a23): undefined reference to std::runtime_error::runtime_error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' test_cpu.cpp:(.text+0x1b35): undefined reference to std::__cxx11::basic_string<char, std::char_traits, std::allocator >::_M_create(unsigned long&, unsigned long)'
test_cpu.cpp:(.text+0x1c39): undefined reference to std::runtime_error::runtime_error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' test_cpu.cpp:(.text+0x1d4d): undefined reference to std::__cxx11::basic_string<char, std::char_traits, std::allocator >::_M_create(unsigned long&, unsigned long)'
CMakeFiles/test_cpu.dir/tests/test_cpu.cpp.o: In function inf_test()': test_cpu.cpp:(.text+0x20e5): undefined reference to std::runtime_error::runtime_error(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)'
test_cpu.cpp:(.text+0x2223): undefined reference to std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)' test_cpu.cpp:(.text+0x22ff): undefined reference to std::runtime_error::runtime_error(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)'
test_cpu.cpp:(.text+0x2416): undefined reference to std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)' CMakeFiles/test_cpu.dir/tests/test_cpu.cpp.o: In function small_test()':
test_cpu.cpp:(.text+0x27cd): undefined reference to std::runtime_error::runtime_error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' test_cpu.cpp:(.text+0x28fa): undefined reference to std::__cxx11::basic_string<char, std::char_traits, std::allocator >::_M_create(unsigned long&, unsigned long)'
test_cpu.cpp:(.text+0x29dd): undefined reference to std::runtime_error::runtime_error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' test_cpu.cpp:(.text+0x2afa): undefined reference to std::__cxx11::basic_string<char, std::char_traits, std::allocator >::_M_create(unsigned long&, unsigned long)'
CMakeFiles/test_cpu.dir/tests/test_cpu.cpp.o: In function std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)': test_cpu.cpp:(.text._ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_OS8_[_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_OS8_]+0x23): undefined reference to std::__cxx11::basic_string<char, std::char_traits, std::allocator >::_M_replace(unsigned long, unsigned long, char const*, unsigned long)'
libwarpctc.so: undefined reference to `GOMP_parallel'
collect2: error: ld returned 1 exit status
CMakeFiles/test_cpu.dir/build.make:123: recipe for target 'test_cpu' failed
make[2]: *** [test_cpu] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/test_cpu.dir/all' failed
make[1]: *** [CMakeFiles/test_cpu.dir/all] Error 2
Makefile:113: recipe for target 'all' failed
make: *** [all] Error 2

When installing, where to set cuda path?

My model can't run on GPU, I figured out it's an error during the installation.
The document says:

Otherwise, set WARP_CTC_PATH to wherever you have libwarpctc.so installed. If you have a GPU, you should also make sure that CUDA_HOME is set to the home cuda directory (i.e. where include/cuda.h and lib/libcudart.so live). For example:

export CUDA_HOME="/usr/local/cuda"

But where should I set the CUDA_HOME???
Is it in the .bashrc? But I've already set! The model is still not running on GPU.

AttributeError: type object '_CTC' has no attribute 'apply'

hi @SeanNaren, there is something wrong with CTCLoss of pytorch binding:

import torch
from torch.autograd import Variable
from warpctc_pytorch import CTCLoss
ctc_loss = CTCLoss()
Traceback (most recent call last):
File "", line 1, in
File "/root/anaconda2/envs/chinese-ocr/lib/python2.7/site-packages/warpctc_pytorch/init.py", line 55, in init
self.ctc = _CTC.apply
AttributeError: type object '_CTC' has no attribute 'apply'
is there some way to solve it?

GPU execution requested, but not compiled with GPU support

When I use cmake, it said CUDA8.0 found. I have installed it without any problem.
Then I tried to use it in my program, I got two problems.
One is when I calculate ctc loss, I got GPU execution requested, but not compiled with GPU support and the program still ran without problem.
In another program, I can calculate ctc loss in cpu, but I can not calculate it in gpu.
I have run test in cpu and gpu and all tests are passed.
Is there any idea I can solve those problem?

OS: CentOS 7.0
GPU: Tesla P40

Cmake error with windows 10, VS 2017

Hi there,
I try to build on window 10, but I got the error:
-- Building shared library with GPU support
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
CUDA_curand_LIBRARY (ADVANCED)
linked by target "test_gpu" in directory C:/Users/ABC/warp-ctc

The detail as bellow:
$ cmake ..
-- Building for: Visual Studio 15 2017
-- Selecting Windows SDK version 10.0.17134.0 to target Windows 10.0.18204.
-- The C compiler identification is MSVC 19.15.26729.0
-- The CXX compiler identification is MSVC 19.15.26729.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.15.26726/bin/Hostx86/x86/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.15.26726/bin/Hostx86/x86/cl.exe -- 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: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.15.26726/bin/Hostx86/x86/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.15.26726/bin/Hostx86/x86/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found CUDA: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v9.2 (found suitable version "9.2", minimum required is "6.5")
-- cuda found TRUE
-- Building shared library with GPU support
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
CUDA_curand_LIBRARY (ADVANCED)
linked by target "test_gpu" in directory C:/Users/ABC/warp-ctc

-- Configuring incomplete, errors occurred!
See also "C:/Users/ABC/warp-ctc/build/CMakeFiles/CMakeOutput.log".

FatalError: std::bad_alloc

I use CPU for warp-ctc, but while i am running a simple example like you show,bad_alloc occurs.I should what to do.
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.