tmbdev / clstm

A small C++ implementation of LSTM networks, focused on OCR.
Apache License 2.0
821 stars 224 forks source link

scons install display=1 failed against latest code #109

Open wanghaisheng opened 8 years ago

wanghaisheng commented 8 years ago
data-clear@dataclear:~/dev/ocr/clstm$ scons
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
g++ --std=c++11 -Wno-unused-result -o clstmfilter.o -c -g -O3 -DEIGEN_NO_DEBUG -DCATCH=catch -DCLSTM_ALL_TENSOR=1 -DNODISPLAY=1 -DTHROW=throw -DTRY=try -I/usr/local/include/eigen3 clstmfilter.cc
g++ --std=c++11 -Wno-unused-result -o clstm.o -c -g -O3 -DEIGEN_NO_DEBUG -DCATCH=catch -DCLSTM_ALL_TENSOR=1 -DNODISPLAY=1 -DTHROW=throw -DTRY=try -I/usr/local/include/eigen3 clstm.cc
g++ --std=c++11 -Wno-unused-result -o ctc.o -c -g -O3 -DEIGEN_NO_DEBUG -DCATCH=catch -DCLSTM_ALL_TENSOR=1 -DNODISPLAY=1 -DTHROW=throw -DTRY=try -I/usr/local/include/eigen3 ctc.cc
protoc(["clstm", "clstm.pb.cc", "clstm.pb.h"], ["clstm.proto"])
g++ --std=c++11 -Wno-unused-result -o clstm_proto.o -c -g -O3 -DEIGEN_NO_DEBUG -DCATCH=catch -DCLSTM_ALL_TENSOR=1 -DNODISPLAY=1 -DTHROW=throw -DTRY=try -I/usr/local/include/eigen3 clstm_proto.cc
g++ --std=c++11 -Wno-unused-result -o clstm_prefab.o -c -g -O3 -DEIGEN_NO_DEBUG -DCATCH=catch -DCLSTM_ALL_TENSOR=1 -DNODISPLAY=1 -DTHROW=throw -DTRY=try -I/usr/local/include/eigen3 clstm_prefab.cc
g++ --std=c++11 -Wno-unused-result -o tensor.o -c -g -O3 -DEIGEN_NO_DEBUG -DCATCH=catch -DCLSTM_ALL_TENSOR=1 -DNODISPLAY=1 -DTHROW=throw -DTRY=try -I/usr/local/include/eigen3 tensor.cc
g++ --std=c++11 -Wno-unused-result -o batches.o -c -g -O3 -DEIGEN_NO_DEBUG -DCATCH=catch -DCLSTM_ALL_TENSOR=1 -DNODISPLAY=1 -DTHROW=throw -DTRY=try -I/usr/local/include/eigen3 batches.cc
g++ --std=c++11 -Wno-unused-result -o extras.o -c -g -O3 -DEIGEN_NO_DEBUG -DCATCH=catch -DCLSTM_ALL_TENSOR=1 -DNODISPLAY=1 -DTHROW=throw -DTRY=try -I/usr/local/include/eigen3 extras.cc
g++ --std=c++11 -Wno-unused-result -o clstm.pb.o -c -g -O3 -DEIGEN_NO_DEBUG -DCATCH=catch -DCLSTM_ALL_TENSOR=1 -DNODISPLAY=1 -DTHROW=throw -DTRY=try -I/usr/local/include/eigen3 clstm.pb.cc
g++ --std=c++11 -Wno-unused-result -o clstm_compute.o -c -g -O3 -DEIGEN_NO_DEBUG -DCATCH=catch -DCLSTM_ALL_TENSOR=1 -DNODISPLAY=1 -DTHROW=throw -DTRY=try -I/usr/local/include/eigen3 clstm_compute.cc
ar rc libclstm.a clstm.o ctc.o clstm_proto.o clstm_prefab.o tensor.o batches.o extras.o clstm.pb.o clstm_compute.o
ranlib libclstm.a
g++ --std=c++11 -Wno-unused-result -o clstmfilter clstmfilter.o libclstm.a -lpng -lprotobuf
g++ --std=c++11 -Wno-unused-result -o clstmfiltertrain.o -c -g -O3 -DEIGEN_NO_DEBUG -DCATCH=catch -DCLSTM_ALL_TENSOR=1 -DNODISPLAY=1 -DTHROW=throw -DTRY=try -I/usr/local/include/eigen3 clstmfiltertrain.cc
g++ --std=c++11 -Wno-unused-result -o clstmfiltertrain clstmfiltertrain.o libclstm.a -lpng -lprotobuf
g++ --std=c++11 -Wno-unused-result -o clstmocr.o -c -g -O3 -DEIGEN_NO_DEBUG -DCATCH=catch -DCLSTM_ALL_TENSOR=1 -DNODISPLAY=1 -DTHROW=throw -DTRY=try -I/usr/local/include/eigen3 clstmocr.cc
g++ --std=c++11 -Wno-unused-result -o clstmocr clstmocr.o libclstm.a -lpng -lprotobuf
g++ --std=c++11 -Wno-unused-result -o clstmocrtrain.o -c -g -O3 -DEIGEN_NO_DEBUG -DCATCH=catch -DCLSTM_ALL_TENSOR=1 -DNODISPLAY=1 -DTHROW=throw -DTRY=try -I/usr/local/include/eigen3 clstmocrtrain.cc
g++ --std=c++11 -Wno-unused-result -o clstmocrtrain clstmocrtrain.o libclstm.a -lpng -lprotobuf
scons: done building targets.
data-clear@dataclear:~/dev/ocr/clstm$ sudo scons install  display=1
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
g++ --std=c++11 -Wno-unused-result -o clstm.o -c -g -O3 -DEIGEN_NO_DEBUG -DCATCH=catch -DCLSTM_ALL_TENSOR=1 -DTHROW=throw -DTRY=try -Dadd_raw=add -I/usr/local/include/eigen3 clstm.cc
g++ --std=c++11 -Wno-unused-result -o ctc.o -c -g -O3 -DEIGEN_NO_DEBUG -DCATCH=catch -DCLSTM_ALL_TENSOR=1 -DTHROW=throw -DTRY=try -Dadd_raw=add -I/usr/local/include/eigen3 ctc.cc
protoc(["clstm", "clstm.pb.cc", "clstm.pb.h"], ["clstm.proto"])
g++ --std=c++11 -Wno-unused-result -o clstm_proto.o -c -g -O3 -DEIGEN_NO_DEBUG -DCATCH=catch -DCLSTM_ALL_TENSOR=1 -DTHROW=throw -DTRY=try -Dadd_raw=add -I/usr/local/include/eigen3 clstm_proto.cc
g++ --std=c++11 -Wno-unused-result -o clstm_prefab.o -c -g -O3 -DEIGEN_NO_DEBUG -DCATCH=catch -DCLSTM_ALL_TENSOR=1 -DTHROW=throw -DTRY=try -Dadd_raw=add -I/usr/local/include/eigen3 clstm_prefab.cc
g++ --std=c++11 -Wno-unused-result -o tensor.o -c -g -O3 -DEIGEN_NO_DEBUG -DCATCH=catch -DCLSTM_ALL_TENSOR=1 -DTHROW=throw -DTRY=try -Dadd_raw=add -I/usr/local/include/eigen3 tensor.cc
g++ --std=c++11 -Wno-unused-result -o batches.o -c -g -O3 -DEIGEN_NO_DEBUG -DCATCH=catch -DCLSTM_ALL_TENSOR=1 -DTHROW=throw -DTRY=try -Dadd_raw=add -I/usr/local/include/eigen3 batches.cc
g++ --std=c++11 -Wno-unused-result -o extras.o -c -g -O3 -DEIGEN_NO_DEBUG -DCATCH=catch -DCLSTM_ALL_TENSOR=1 -DTHROW=throw -DTRY=try -Dadd_raw=add -I/usr/local/include/eigen3 extras.cc
In file included from extras.cc:42:0:
pytensor.h: In member function 'void pytensor::PyServer::plot(pytensor::Tensor<float, 1ul>&, std::__cxx11::string)':
pytensor.h:155:54: error: no matching function for call to 'pytensor::PyServer::eval(std::__cxx11::string, pytensor::Tensor<float, 1ul>&)'
     eval(stringf("plot(farg(1)%s)", extra.c_str()), v);
                                                      ^
pytensor.h:88:10: note: candidate: std::__cxx11::string pytensor::PyServer::eval(std::__cxx11::string)
   string eval(string s) {
          ^
pytensor.h:88:10: note:   candidate expects 1 argument, 2 provided
pytensor.h:108:10: note: candidate: template<class T, long unsigned int n> std::__cxx11::string pytensor::PyServer::eval(std::__cxx11::string, pytensor::Tensor<T, n>&)
   string eval(string s, Tensor<T, n> &a) {
          ^
pytensor.h:108:10: note:   template argument deduction/substitution failed:
pytensor.h:155:54: note:   mismatched types 'long unsigned int' and 'int'
     eval(stringf("plot(farg(1)%s)", extra.c_str()), v);
                                                      ^
pytensor.h:155:54: note:   'pytensor::Tensor<float, 1ul> {aka Eigen::Tensor<float, 1>}' is not derived from 'pytensor::Tensor<T, n>'
pytensor.h:124:10: note: candidate: template<class T, long unsigned int n, class S, long unsigned int m> std::__cxx11::string pytensor::PyServer::eval(std::__cxx11::string, pytensor::Tensor<T, n>&, pytensor::Tensor<S, m>&)
   string eval(string s, Tensor<T, n> &a, Tensor<S, m> &b) {
          ^
pytensor.h:124:10: note:   template argument deduction/substitution failed:
pytensor.h:155:54: note:   mismatched types 'long unsigned int' and 'int'
     eval(stringf("plot(farg(1)%s)", extra.c_str()), v);
                                                      ^
pytensor.h:155:54: note:   'pytensor::Tensor<float, 1ul> {aka Eigen::Tensor<float, 1>}' is not derived from 'pytensor::Tensor<T, n>'
pytensor.h: In member function 'void pytensor::PyServer::plot2(pytensor::Tensor<float, 1ul>&, pytensor::Tensor<float, 1ul>&, std::__cxx11::string)':
pytensor.h:161:65: error: no matching function for call to 'pytensor::PyServer::eval(std::__cxx11::string, pytensor::Tensor<float, 1ul>&, pytensor::Tensor<float, 1ul>&)'
     eval(stringf("plot(farg(1),farg(2)%s)", extra.c_str()), u, v);
                                                                 ^
pytensor.h:88:10: note: candidate: std::__cxx11::string pytensor::PyServer::eval(std::__cxx11::string)
   string eval(string s) {
          ^
pytensor.h:88:10: note:   candidate expects 1 argument, 3 provided
pytensor.h:108:10: note: candidate: template<class T, long unsigned int n> std::__cxx11::string pytensor::PyServer::eval(std::__cxx11::string, pytensor::Tensor<T, n>&)
   string eval(string s, Tensor<T, n> &a) {
          ^
pytensor.h:108:10: note:   template argument deduction/substitution failed:
pytensor.h:161:65: note:   mismatched types 'long unsigned int' and 'int'
     eval(stringf("plot(farg(1),farg(2)%s)", extra.c_str()), u, v);
                                                                 ^
pytensor.h:161:65: note:   'pytensor::Tensor<float, 1ul> {aka Eigen::Tensor<float, 1>}' is not derived from 'pytensor::Tensor<T, n>'
pytensor.h:124:10: note: candidate: template<class T, long unsigned int n, class S, long unsigned int m> std::__cxx11::string pytensor::PyServer::eval(std::__cxx11::string, pytensor::Tensor<T, n>&, pytensor::Tensor<S, m>&)
   string eval(string s, Tensor<T, n> &a, Tensor<S, m> &b) {
          ^
pytensor.h:124:10: note:   template argument deduction/substitution failed:
pytensor.h:161:65: note:   mismatched types 'long unsigned int' and 'int'
     eval(stringf("plot(farg(1),farg(2)%s)", extra.c_str()), u, v);
                                                                 ^
pytensor.h:161:65: note:   'pytensor::Tensor<float, 1ul> {aka Eigen::Tensor<float, 1>}' is not derived from 'pytensor::Tensor<T, n>'
pytensor.h: In member function 'void pytensor::PyServer::imshow(pytensor::Tensor<float, 2ul>&, std::__cxx11::string)':
pytensor.h:167:11: error: no matching function for call to 'pytensor::PyServer::eval(std::__cxx11::string, pytensor::Tensor<float, 2ul>&)'
          a);
           ^
pytensor.h:88:10: note: candidate: std::__cxx11::string pytensor::PyServer::eval(std::__cxx11::string)
   string eval(string s) {
          ^
pytensor.h:88:10: note:   candidate expects 1 argument, 2 provided
pytensor.h:108:10: note: candidate: template<class T, long unsigned int n> std::__cxx11::string pytensor::PyServer::eval(std::__cxx11::string, pytensor::Tensor<T, n>&)
   string eval(string s, Tensor<T, n> &a) {
          ^
pytensor.h:108:10: note:   template argument deduction/substitution failed:
pytensor.h:167:11: note:   mismatched types 'long unsigned int' and 'int'
          a);
           ^
pytensor.h:167:11: note:   'pytensor::Tensor<float, 2ul> {aka Eigen::Tensor<float, 2>}' is not derived from 'pytensor::Tensor<T, n>'
pytensor.h:124:10: note: candidate: template<class T, long unsigned int n, class S, long unsigned int m> std::__cxx11::string pytensor::PyServer::eval(std::__cxx11::string, pytensor::Tensor<T, n>&, pytensor::Tensor<S, m>&)
   string eval(string s, Tensor<T, n> &a, Tensor<S, m> &b) {
          ^
pytensor.h:124:10: note:   template argument deduction/substitution failed:
pytensor.h:167:11: note:   mismatched types 'long unsigned int' and 'int'
          a);
           ^
pytensor.h:167:11: note:   'pytensor::Tensor<float, 2ul> {aka Eigen::Tensor<float, 2>}' is not derived from 'pytensor::Tensor<T, n>'
pytensor.h: In member function 'void pytensor::PyServer::imshowT(pytensor::Tensor<float, 2ul>&, std::__cxx11::string)':
pytensor.h:173:11: error: no matching function for call to 'pytensor::PyServer::eval(std::__cxx11::string, pytensor::Tensor<float, 2ul>&)'
          a);
           ^
pytensor.h:88:10: note: candidate: std::__cxx11::string pytensor::PyServer::eval(std::__cxx11::string)
   string eval(string s) {
          ^
pytensor.h:88:10: note:   candidate expects 1 argument, 2 provided
pytensor.h:108:10: note: candidate: template<class T, long unsigned int n> std::__cxx11::string pytensor::PyServer::eval(std::__cxx11::string, pytensor::Tensor<T, n>&)
   string eval(string s, Tensor<T, n> &a) {
          ^
pytensor.h:108:10: note:   template argument deduction/substitution failed:
pytensor.h:173:11: note:   mismatched types 'long unsigned int' and 'int'
          a);
           ^
pytensor.h:173:11: note:   'pytensor::Tensor<float, 2ul> {aka Eigen::Tensor<float, 2>}' is not derived from 'pytensor::Tensor<T, n>'
pytensor.h:124:10: note: candidate: template<class T, long unsigned int n, class S, long unsigned int m> std::__cxx11::string pytensor::PyServer::eval(std::__cxx11::string, pytensor::Tensor<T, n>&, pytensor::Tensor<S, m>&)
   string eval(string s, Tensor<T, n> &a, Tensor<S, m> &b) {
          ^
pytensor.h:124:10: note:   template argument deduction/substitution failed:
pytensor.h:173:11: note:   mismatched types 'long unsigned int' and 'int'
          a);
           ^
pytensor.h:173:11: note:   'pytensor::Tensor<float, 2ul> {aka Eigen::Tensor<float, 2>}' is not derived from 'pytensor::Tensor<T, n>'
scons: *** [extras.o] Error 1
scons: building terminated because of errors.

but scons install is ok

data-clear@dataclear:~/dev/ocr/clstm$ python setup.py build
PY_CORE_CFLAGS -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security   -I. -IInclude -I../Include -fPIC -DPy_BUILD_CORE
LDCXXSHARED c++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions
BLDSHARED x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security  
LDFLAGS -Wl,-Bsymbolic-functions -Wl,-z,relro
TESTPYTHON LD_LIBRARY_PATH=/build/python2.7-M_HuAO/python2.7-2.7.12/build-shared ./python -Wd -3 -E -tt
CONFIG_ARGS '--enable-shared' '--prefix=/usr' '--enable-ipv6' '--enable-unicode=ucs4' '--with-dbmliborder=bdb:gdbm' '--with-system-expat' '--with-computed-gotos' '--with-system-ffi' '--with-fpectl' 'CC=x86_64-linux-gnu-gcc' 'CFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security ' 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro'
CONFIGURE_CFLAGS -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security
LDSHARED x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security  
CONFIGURE_LDFLAGS -Wl,-Bsymbolic-functions -Wl,-z,relro
OPT -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes
PY_LDFLAGS -Wl,-Bsymbolic-functions -Wl,-z,relro
LINKFORSHARED -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions
PY_CFLAGS -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security  
CFLAGS -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security  
sh: 1: swig: not found
running build
running build_py
file clstm.py (for module clstm) not found
file clstm.py (for module clstm) not found
running build_ext
building '_clstm' extension
swigging clstm.i to clstm_wrap.cpp
swig -python -c++ -I/usr/include/eigen3 -I/usr/local/include/eigen3 -I/usr/local/include -I/usr/include/hdf5/serial -I/usr/lib/python2.7/dist-packages/numpy/core/include -o clstm_wrap.cpp clstm.i
unable to execute 'swig': No such file or directory
error: command 'swig' failed with exit status 1
data-clear@dataclear:~/dev/ocr/clstm$ sudo scons install  
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
g++ --std=c++11 -Wno-unused-result -o clstm.o -c -g -O3 -DEIGEN_NO_DEBUG -DCATCH=catch -DCLSTM_ALL_TENSOR=1 -DNODISPLAY=1 -DTHROW=throw -DTRY=try -I/usr/local/include/eigen3 clstm.cc
g++ --std=c++11 -Wno-unused-result -o ctc.o -c -g -O3 -DEIGEN_NO_DEBUG -DCATCH=catch -DCLSTM_ALL_TENSOR=1 -DNODISPLAY=1 -DTHROW=throw -DTRY=try -I/usr/local/include/eigen3 ctc.cc
protoc(["clstm", "clstm.pb.cc", "clstm.pb.h"], ["clstm.proto"])
g++ --std=c++11 -Wno-unused-result -o clstm_proto.o -c -g -O3 -DEIGEN_NO_DEBUG -DCATCH=catch -DCLSTM_ALL_TENSOR=1 -DNODISPLAY=1 -DTHROW=throw -DTRY=try -I/usr/local/include/eigen3 clstm_proto.cc
g++ --std=c++11 -Wno-unused-result -o clstm_prefab.o -c -g -O3 -DEIGEN_NO_DEBUG -DCATCH=catch -DCLSTM_ALL_TENSOR=1 -DNODISPLAY=1 -DTHROW=throw -DTRY=try -I/usr/local/include/eigen3 clstm_prefab.cc
g++ --std=c++11 -Wno-unused-result -o tensor.o -c -g -O3 -DEIGEN_NO_DEBUG -DCATCH=catch -DCLSTM_ALL_TENSOR=1 -DNODISPLAY=1 -DTHROW=throw -DTRY=try -I/usr/local/include/eigen3 tensor.cc
g++ --std=c++11 -Wno-unused-result -o batches.o -c -g -O3 -DEIGEN_NO_DEBUG -DCATCH=catch -DCLSTM_ALL_TENSOR=1 -DNODISPLAY=1 -DTHROW=throw -DTRY=try -I/usr/local/include/eigen3 batches.cc
g++ --std=c++11 -Wno-unused-result -o extras.o -c -g -O3 -DEIGEN_NO_DEBUG -DCATCH=catch -DCLSTM_ALL_TENSOR=1 -DNODISPLAY=1 -DTHROW=throw -DTRY=try -I/usr/local/include/eigen3 extras.cc
Install file: "libclstm.a" as "/usr/local/lib/libclstm.a"
Install file: "clstm.h" as "/usr/local/include/clstm.h"
scons: done building targets.
kba commented 8 years ago

In the title, you have a typo, it should be scons display=1 install (not dislplay). Not sure why you get these errors for just scons without display=1.

I can confirm that pytensor.h is broken for display=1.

kba commented 8 years ago

@wanghaisheng Can you try https://github.com/tmbdev/clstm/pull/110? I've never used the display features before, but this will fix the long unsigned int/int errors.

hellbago commented 7 years ago

same issue also for me. Any updates about this? Basically what kind of plot one can obtain if it work properly?

stweil commented 6 years ago

Where does the mismatched int come from? Could we change it to size_t?

kba commented 6 years ago

@stweil ~See #110 for int -> size_t, that fixes the template argument errors.~ Sorry, did not read that right, yes, size_t would probably be the more appropriate type. If you find a proper fix, I'm happy to merge it. Getting display=1 to work requires zeromq (libzqmpp) and running display_server.py IIUC.

stweil commented 6 years ago

I can reproduce the problem on Debian Stretch (with libzmq3-dev, libzmq5, libzmqpp-dev and libzmqpp3 packages from Ubuntu), but I'm still searching for the int which is mentioned in the error messages. I agree that #110 could work but does not look like the right fix.