-
Notifications
You must be signed in to change notification settings - Fork 552
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compilation error with the current TH++ #1
Comments
The problem was not compatibility with TH++ but with the newest fblualib library. fblualib::luaGetTensorChecked() returns newly TensorPtr and not Tensor. |
Thanks for your feedback. I have just updated by fblualib to the latest version. However, the compilation goes well on my machine. Maybe it's due the OS or compiler. Still looking into this issue by viewing the thpp source. |
I updated my comment above. from fblualib - LuaUtils-inl.h |
I solved it by "downgrading" fblualib (commit: bdcf94bb835c41b5d822371fb6f7b75c1d53efbc) and thpp (commit: ebb4fcbb4a9b3310ac0a36eb37775a45f111448b). |
@moraval Glad to hear that. The widths are not 1-pixel. I have not calculate the precise width of the receptive fields. I guess it's 8 pixels. Note that CNN takes whole image as input, not the receptive fields. |
@bgshih I have encountered the same problem and I have tried your solution of downgrading. But it seems that it doesn't work now. |
@CatWang I tried again using Torch and THPP of the latest version. However, I still could not reproduce any compiling errors. Can you describe your environment, e.g. operating system? |
I meet the same problem and solve it like @moraval. Thanks |
but when I run demo, I got this: Loading model... how to solve this? @moraval Thanks |
I know this is an old thread, but having the same issue when compiling:
I have tried downgrading as suggested by @moraval , but unable to get them to compile due to other dependencies. Can you please help with a recommendation or updating the code? I am actually trying to use this code inside TextBoxes++ but also having the same issue with it's modified crnn package. Thanks in advance. By the way, I have all the fblualib dependencies compiled, torch, etc. I am on Ubuntu 16.04 Thank you |
@jmrichardson Same problem, have you solved the problem yet?
I cloned the Textboxes_plusplus at the HEAD, and installed the dependencies,
Now everything looks OK, but the crnn can not still compiled. The problem seems the fblualib has changed its API. Need to know which version the CRNN used to build. |
The compile error is because the type "thpp::Tensor&" is different with the type "thpp::Ptr<Tensor >", that is, the reference type and the pointer type.
So the modification is the change all the
The ctc.cpp modification is as follows:
And then build, Done! |
I did what @umdreamer suggested. The code was built without error. but when I am running the demo.lua in Textbox_plusplus, the code stopped at the line after the changes(line 157): |
with a simple function as
we do get a core so I don't know how to fix the core (I'm all new to lua and fb*) so hopefully someone more competent will give a help However constructs such as
are wrong because
actually instanciate a THType*
and return a TensorPtr BUT when you dereference the TensorPtr
you get the rawpointer (I presume linking to the very same THType*)
then your input variable has an underlying THType* pointing to a wrong area Better (at least somehow working) code is:
or
long story short below diff works for me
|
@mpech, Thank you for your modification. I get code compiled, and can run the demo sucessfully. As I didn't notice that the code fblualib::luaGetTensorChecked(L,1) actually is to create a new object. So in the runtime, the Core will be dumped to indicate error. Now it works using your code. Cheers. |
Hi, I get compilation errors when building the cpp part. I suspect that I have a wrong version of TH++ but there does not seem to be a better candidate in the thpp project history (v1.0 seems too old).
Also, I'm building it on a newer Ubuntu (15.10), but I don't see how this could cause the following compilation errors. I tried both g++ version 4.9 and 5.2. Any hint appreciated!
~/crnn/src$ ./build_cpp.sh -- The C compiler identification is GNU 4.9.3
-- The CXX compiler identification is GNU 4.9.3
[...]
-- Try OpenMP C flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Success
-- Try OpenMP CXX flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Success
-- Found OpenMP: -fopenmp
-- Configuring done
-- Generating done
-- Build files have been written to: /home/alena/crnn/src/cpp/build
Scanning dependencies of target crnn
[ 50%] Building CXX object CMakeFiles/crnn.dir/init.cpp.o
[100%] Building CXX object CMakeFiles/crnn.dir/ctc.cpp.o
/home/alena/crnn/src/cpp/ctc.cpp: In instantiation of ‘int {anonymous}::forwardBackward(lua_State_) [with T = float; lua_State = lua_State]’:
/home/alena/crnn/src/cpp/ctc.cpp:194:16: required from ‘const luaL_Reg {anonymous}::Registerer::functions_ [3]’
/home/alena/crnn/src/cpp/ctc.cpp:203:44: required from ‘static void {anonymous}::Registerer::registerFunctions(lua_State_) [with T = float; lua_State = lua_State]’
/home/alena/crnn/src/cpp/ctc.cpp:210:24: required from here
/home/alena/crnn/src/cpp/ctc.cpp:22:76: error: conversion from ‘thpp::TensorBase<float, thpp::Storage, thpp::Tensor >::Ptr {aka thpp::TensorPtrthpp::Tensor}’ to non-scalar type ‘const thpp::Tensor’ requested
const thpp::Tensor input = fblualib::luaGetTensorChecked(L, 1);
^
/home/alena/crnn/src/cpp/ctc.cpp:23:78: error: conversion from ‘thpp::TensorBase<int, thpp::Storage, thpp::Tensor >::Ptr {aka thpp::TensorPtrthpp::Tensor}’ to non-scalar type ‘const thpp::Tensor’ requested
const thpp::Tensor targets = fblualib::luaGetTensorChecked(L, 2);
^
The text was updated successfully, but these errors were encountered: