Giter Club home page Giter Club logo

Comments (18)

ngaloppo avatar ngaloppo commented on June 29, 2024 2

@ajtulloch We're trying to convert the pretrained Resnet Torch models here with torch2caffe but running into a problem where SpatialBatchNormalization layer is not supported. Do you have any update on adding support for that? How would we go about doing that?

from fb-caffe-exts.

ajtulloch avatar ajtulloch commented on June 29, 2024 1

Sure, I need to resync with our internal branch. Give me a few hours.

from fb-caffe-exts.

vimalthilak avatar vimalthilak commented on June 29, 2024

I worked around this issue by using LD_PRELOAD to load libcaffe shared object. I did encounter other issues such as unimplemented layers (LRN) which I was able to handle as well. I'm going to close this issue out and open a separate issue for other questions. Thanks!

from fb-caffe-exts.

ajtulloch avatar ajtulloch commented on June 29, 2024

Hi Vimalthilak,

Sorry I missed this - yes, this uses fblualib's Python, so you need to ensure that pycaffe, libcaffe.so is on PYTHONPATH, etc.

For the additional layers - we're essentially adding them as-needed. I need to sync up and add a few new ones (cudnn.SpatialBatchNormalization, nn.CAddTable I think are the only additions). LRN would be cool - I assume you mean cudnn.SpatialCrossMapLRN?

from fb-caffe-exts.

vimalthilak avatar vimalthilak commented on June 29, 2024

Hi @ajtulloch,

Thanks for the response!

  • I assume you mean cudnn.SpatialCrossMapLRN?

It can be cudnn.SpatialCrossMapLRN or nn.SpatialCrossMapLRN. This layer is easy enough that I hacked around lib.lua and lib_py.py (IIRC) to get these to work.

By any chance, have you had a chance to port the model in https://github.com/soumith/inception.torch to caffe.

A port of inception-v3 would be nice as well but that requires batch normalization layer. Not sure if it's doable as-is.

I am happy to provide any help, if doable, if that helps with your effort to develop and add features to and/or test this library.

Thanks!

from fb-caffe-exts.

fhdiaze avatar fhdiaze commented on June 29, 2024

Hi,

Where did you find torch2caffe.lib? I am getting the next error:

/usr/local/bin/luajit: torch2caffe.lua:9: module 'torch2caffe.lib' not found:No LuaRocks module found for torch2caffe.lib

Thanks

from fb-caffe-exts.

vimalthilak avatar vimalthilak commented on June 29, 2024

@fhdiaze It's the lib module under torch2caffe. I think you need to ensure that lib under /torch2caffe is in the path somewhere.

from fb-caffe-exts.

fhdiaze avatar fhdiaze commented on June 29, 2024

@vimalthilak thanks for the response, which file do you mean? all? I do not have so much experience with lua.

Thanks.

from fb-caffe-exts.

ajtulloch avatar ajtulloch commented on June 29, 2024

It should work if you have the torch2caffe directory somewhere in package.path in Lua.

from fb-caffe-exts.

fhdiaze avatar fhdiaze commented on June 29, 2024

Hi,

I am doing:

package.path = package.path .. ';/home/fhdiaze/Code/fb-caffe-exts/torch2caffe/?.lua

and after that

local t2c = require 'torch2caffe.lib'

But I am getting the next error:

[string "local t2c = require 'torch2caffe.lib'..."]:1: module 'torch2caffe.lib' not found:No LuaRocks module found for torch2caffe.lib

Do I have to install using luarocks?

Thanks

from fb-caffe-exts.

ajtulloch avatar ajtulloch commented on June 29, 2024

Does something like http://stackoverflow.com/questions/18125775/lua-require-fails-to-find-submodule-but-searchpath-succeeds work?

from fb-caffe-exts.

ajtulloch avatar ajtulloch commented on June 29, 2024

Sure, I need to resync with our internal branch. Give me a few hours.

from fb-caffe-exts.

ngaloppo avatar ngaloppo commented on June 29, 2024

@ajtulloch 👍 thanks!

from fb-caffe-exts.

ngaloppo avatar ngaloppo commented on June 29, 2024

@ajtulloch Do you have any update on the resync? Thanks!

from fb-caffe-exts.

J6767 avatar J6767 commented on June 29, 2024

I have got the test running now (penlight was causing problems), but all are failing:

Using `cudnn`   
>>>>>>>>> Test  
>>> Test:testAlexnet    

Failed  
>>> Test:testConvolution    

Failed  
>>> Test:testDropout    

Failed  
>>> Test:testFBThreshold    

Failed  
>>> Test:testGoogLeNet  

Failed  
>>> Test:testInception  

Failed  
>>> Test:testInceptionComponents    
checking model  
nn.Sequential {
  [input -> (1) -> (2) -> (3) -> output]
  (1): nn.SpatialConvolution(3 -> 1, 1x1)
  (2): nn.Dropout(0.500000)
  (3): nn.ReLU
}

Failed  
>>> Test:testLinear 

Failed  
>>> Test:testParallelModel  

Failed  
>>> Test:testReLU   

Failed  
>>> Test:testSequential 

Failed  
>>> Test:testSpatialConvolutionMM   

Failed  
>>> Test:testSpatialMaxPooling  

Failed  
>>> Test:testVggCombined    

Failed  
>>> Test:testVggConv    

Failed  
>>> Test:testVggLinear  

Failed  
>>> Test:testView   

Failed   

The error is due to:
t2c.run(opts, module) --attempt to call field 'run' (a nil value)

If anyone knows the root of this problem, please post. Thanks.

from fb-caffe-exts.

KevinYuk avatar KevinYuk commented on June 29, 2024

HI @ajtulloch, have you resync with your internal branch? It seems that is still report "Unknown layer type: nn.SpatialBatchNormalization".
thanks.

from fb-caffe-exts.

MFarooqAit avatar MFarooqAit commented on June 29, 2024

Dear ajtulloch
i have the same error...can you help me in this regard

/usr/bin/luajit: /usr/share/lua/5.1/trepl/init.lua:384: /usr/share/lua/5.1/trepl/init.lua:384: module 'fb.python' not found:No LuaRocks module found for fb.python
no field package.preload['fb.python']
no file '/tmp/buildd/.luarocks/share/lua/5.1/fb/python.lua'
no file '/tmp/buildd/.luarocks/share/lua/5.1/fb/python/init.lua'
no file '/usr/share/lua/5.1/fb/python.lua'
no file '/usr/share/lua/5.1/fb/python/init.lua'
no file './fb/python.lua'
no file '/usr/share/luajit-2.1.0-beta1/fb/python.lua'
no file '/usr/local/share/lua/5.1/fb/python.lua'
no file '/usr/local/share/lua/5.1/fb/python/init.lua'
no file '/home/siraj/.luarocks/share/lua/5.1/fb/python.lua'
no file '/home/siraj/.luarocks/share/lua/5.1/fb/python/init.lua'
no file '/tmp/buildd/.luarocks/lib/lua/5.1/fb/python.so'
no file '/usr/lib/lua/5.1/fb/python.so'
no file './fb/python.so'
no file '/usr/local/lib/lua/5.1/fb/python.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
no file '/home/siraj/.luarocks/lib/lua/5.1/fb/python.so'
no file '/tmp/buildd/.luarocks/lib/lua/5.1/fb.so'
no file '/usr/lib/lua/5.1/fb.so'
no file './fb.so'
no file '/usr/local/lib/lua/5.1/fb.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
no file '/home/siraj/.luarocks/lib/lua/5.1/fb.so'
stack traceback:
[C]: in function 'error'
/usr/share/lua/5.1/trepl/init.lua:384: in function 'require'
main.lua:8: in main chunk
[C]: in function 'dofile'
/usr/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
[C]: at 0x00406670
Error using run (line 38)
Failed to run Torch7 script.

from fb-caffe-exts.

msiraj83 avatar msiraj83 commented on June 29, 2024

@ajtulloch I have follow your steps... I compile Caffe with pycaffe and insert the path in .bashrc file. But now i got this error...
matlab_erro
matlab_error_2

Can you help me in this regards..

Thanks

from fb-caffe-exts.

Related Issues (20)

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.