Closed szagoruyko closed 8 years ago
oh exactly the same issue as https://github.com/facebook/fb-caffe-exts/issues/2, closing this one although it doesnt help me much
@szagoruyko For 2) does vanilla pycaffe work when you import caffe from Python? I wonder if it's fb.python specific or prexisting. For 1) I guess just adding a __init__.py
in torch2caffe/ should fix the import issue, (fbconfig/fbmake inserts those __init__.py
files automatically).
thanks Andrew, __init__.py
helped with 1), didnt know that. Adding LD_PRELOAD with libcaffe.so solved the other issue, dont know why though.
So if anyone else has issues that's thats what I had to do run it:
touch torch2caffe/__init__.py
sed -i.bak 's/local logging/-- local logging/' torch2caffe/*lua
sed -i.bak 's/logging\.infof/print/' torch2caffe/*lua
sed -i.bak 's/logging\.info/print/' torch2caffe/*lua
sed -i.bak 's/logging\.errorf/error/' torch2caffe/*lua
sed -i.bak 's/logging\.fatalf/error/' torch2caffe/*lua
LD_PRELOAD=.../libcaffe.so
PYTHONPATH=$PYTHONPATH:.../caffe/python:.../fb-caffe-exts
Thanks for the detailed info @szagoruyko, I don't understand why LD_PRELOAD'ing libcaffe.so is necessary, I wonder if there's something internal in fbcode that is masking this.
Hi guys,
I added torch2caffe/__init__.py
, but still got the error:
ImportError: No module named torch2caffe.lib_py
Then I modified it to run from torch2caffe folder, the error still exist:
ImportError: No module named lib_py
For a minimal case as below:
local py = require('fb.python')
local ny = py.import('numpy')
local t2c = py.import('lib_py')
local ny = py.import('numpy')
works but t2c = py.import('lib_py')
fails.
Any hints on that?
Thanks!
I've got two problems trying to use torch2caffe, one is in the beginning when I run
I have
no matter how I mess with
PYTHONPATH
Then, if I just modify it to work from torch2caffe folder I've got more interesting:
any ideas? thanks