facebookresearch / multipathnet

A Torch implementation of the object detection network from "A MultiPath Network for Object Detection" (https://arxiv.org/abs/1604.02135)
Other
1.34k stars 275 forks source link

Attempt to concentate a nil value #41

Open archenroot opened 7 years ago

archenroot commented 7 years ago

I just finished the whole stack installation (half via ebuilds, half from sources) on Gentoo system. Thing is that any lua file I try to execute via th something.lua is ending as:

ares multipathnet # th demo.lua 
luajit: /usr/share/lua/5.1/trepl/init.lua:389: /usr/share/lua/5.1/trepl/init.lua:389: /usr/share/lua/5.1/trepl/init.lua:389: /usr/share/lua/5.1/trepl/init.lua:389: /usr/share/lua/5.1/trepl/init.lua:389: /usr/share/lua/5.1/trepl/init.lua:389: /usr/share/lua/5.1/trepl/init.lua:389: /usr/share/lua/5.1/trepl/init.lua:389: /usr/share/lua/5.1/torch/init.lua:54: attempt to concatenate a nil value
stack traceback:
    [C]: in function 'error'
    /usr/share/lua/5.1/trepl/init.lua:389: in function 'require'
    demo.lua:15: in main chunk
    [C]: in function 'dofile'
    /usr/bin/th:150: in main chunk
    [C]: at 0x004045a0
ares multipathnet # th Tester_FRCNN.lua 
luajit: /usr/share/lua/5.1/trepl/init.lua:389: /usr/share/lua/5.1/trepl/init.lua:389: /usr/share/lua/5.1/trepl/init.lua:389: /usr/share/lua/5.1/trepl/init.lua:389: /usr/share/lua/5.1/trepl/init.lua:389: /usr/share/lua/5.1/trepl/init.lua:389: /usr/share/lua/5.1/torch/init.lua:54: attempt to concatenate a nil value
stack traceback:
    [C]: in function 'error'
    /usr/share/lua/5.1/trepl/init.lua:389: in function 'require'
    /mnt/data/proj/neural-networks/multipathnet/utils.lua:11: in main chunk
    [C]: in function 'dofile'
    Tester_FRCNN.lua:9: in main chunk
    [C]: in function 'dofile'
    /usr/bin/th:150: in main chunk
    [C]: at 0x004045a0

I think I am missing something in general, but the error doesn't not lead me to resolution...

Thanks for any hints.

Ladislav

szagoruyko commented 7 years ago

Can you do:

require 'fbcoco'

in the interpreter and see if it gives a better error trace?

archenroot commented 7 years ago

Hi guys, ahh, now I see, there are 2 "coco" modules required. Just to let you know the context, I am wrapping all the torch packages in the Gentoo ebuild system which are available ArchenRoot Gentoo Overlay. It is still very experimental and some of modules I had to install still manually as would like to have quickly Multipathnet available.

I can confirm that I can do:

th> require 'coco'
{
  TensorTable : {...}
  MaskApi : 
    {
      merge : function: 0x406d7698
      area : function: 0x41b1d8e8
      _rlesFree : function: 0x406d7708
      frBbox : function: 0x41b1d938
      nms : function: 0x406d7750
      drawMasks : function: 0x415cd7c0
      _rlesFrLua : function: 0x406d7778
      _rlesToLua : function: 0x406d76c0
      _rlesInit : function: 0x406d77a0
      toBbox : function: 0x41b1d910
      decode : function: 0x415cd7f8
      encode : function: 0x415cf488
      iou : function: 0x406d7728
      frPoly : function: 0x41b1d960
      drawLine : function: 0x41b1d988
      drawCirc : function: 0x415cdad0
    }
  CocoSeg : {...}
  libmaskapi : userdata: 0x407a0d00
  CocoApi : {...}
}

but when trying to test fbcoco (found in demo.lua), it is not available:

th> require 'fbcoco'
/usr/share/lua/5.1/trepl/init.lua:389: module 'fbcoco' not found:
    no field package.preload['fbcoco']
    no file './fbcoco.lua'
    no file '/usr/share/luajit-2.0.4/fbcoco.lua'
    no file '/usr/local/share/lua/5.1/fbcoco.lua'
    no file '/usr/local/share/lua/5.1/fbcoco/init.lua'
    no file '/usr/share/lua/5.1/fbcoco.lua'
    no file '/usr/share/lua/5.1/fbcoco/init.lua'
    no file './fbcoco.so'
    no file '/usr/local/lib/lua/5.1/fbcoco.so'
    no file '/usr/lib64/lua/5.1/fbcoco.so'
    no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
    [C]: in function 'error'
    /usr/share/lua/5.1/trepl/init.lua:389: in function 'require'
    [string "_RESULT={require 'fbcoco'}"]:1: in main chunk
    [C]: in function 'xpcall'
    /usr/share/lua/5.1/trepl/init.lua:661: in function 'repl'
    /usr/bin/th:204: in main chunk
    [C]: at 0x004045a0  

I didn't know there are 2 coco libraries, but understand first is standard one which consists of following files:

ares coco # ls
CocoApi.lua  env.lua  init.lua  MaskApi.lua

and the second one -> fbcoco, which is only referenced directly in this repository and I was not able to find it anywhere else. When I look at fbcoco.lua file I understand it refers to some underlaying files. So what I tried to do now was install manually fbcoco related files as following into my lua subsystem, where all Torch modules are installed and working:

ares 5.1 # pwd
/usr/share/lua/5.1
ares 5.1 # tree fbcoco
fbcoco
├── BatchProviderBase.lua
├── BatchProviderROI.lua
├── init.lua (renamed fbcoco.lua file as required by lua subsystem)
├── ImageDetect.lua
├── modules
│   ├── BBoxNorm.lua
│   ├── BBoxRegressionCriterion.lua
│   ├── ContextRegion.lua
│   ├── ConvertFrom.lua
│   ├── Foveal.lua
│   ├── ImageTransformer.lua
│   ├── ModelParallelTable.lua
│   ├── ModeSwitch.lua
│   ├── NoBackprop.lua
│   ├── SelectBoxes.lua
│   ├── SequentialSplitBatch.lua
│   └── test.lua
├── testCoco
│   ├── coco.lua
│   └── init.lua
└── Tester_FRCNN.lua

2 directories, 19 files

I am now going to give it a try.

archenroot commented 7 years ago

So when I try now to execute require I get:

ares multipathnet # th 

  ______             __   |  Torch7 
 /_  __/__  ________/ /   |  Scientific computing for Lua. 
  / / / _ \/ __/ __/ _ \  |  Type ? for help 
 /_/  \___/_/  \__/_//_/  |  https://github.com/torch 
                          |  http://torch.ch 

th> require 'fbcoco'
/usr/share/lua/5.1/trepl/init.lua:389: /usr/share/lua/5.1/trepl/init.lua:389: /usr/share/lua/5.1/trepl/init.lua:389: /usr/share/lua/5.1/trepl/init.lua:389: /usr/share/lua/5.1/trepl/init.lua:389: /usr/share/lua/5.1/trepl/init.lua:389: /usr/share/lua/5.1/trepl/init.lua:389: /usr/share/lua/5.1/trepl/init.lua:389: /usr/share/lua/5.1/torch/init.lua:54: attempt to concatenate a nil value
stack traceback:
    [C]: in function 'error'
    /usr/share/lua/5.1/trepl/init.lua:389: in function 'require'
    [string "_RESULT={require 'fbcoco'}"]:1: in main chunk
    [C]: in function 'xpcall'
    /usr/share/lua/5.1/trepl/init.lua:661: in function 'repl'
    /usr/bin/th:204: in main chunk
    [C]: at 0x004045a0  
                                                                      [0.1189s] 
th>