I've been able to get some elements of Ocropus working under Ubuntu.
Below is a a couple of things I found out to save others the trouble.
I'm stuck at the moment running though the training video:
http://www.youtube.com/watch?v=cQ7vW7rZLUw

Any help much appreciated, making slow but steady progress. Does this
group currently use IRC? Anyone interested in starting a group?

Running:

~/ocropy$ ocropus-extract-rsegs book/????/??????.png

Produces:

Traceback (most recent call last):
  File "/usr/local/bin/ocropus-extract-rsegs", line 37, in <module>
    show()
  File "/usr/lib/pymodules/python2.6/matplotlib/backends/backend_tkagg.py",
line 79, in show
    Tk.mainloop()
  File "/usr/lib/python2.6/lib-tk/Tkinter.py", line 328, in mainloop
    _default_root.tk.mainloop(n)
AttributeError: 'NoneType' object has no attribute 'tk'

Install notes:
Prerequsites for Ubuntu 10.10
1. > 1.6Gig Ram - compiling openfst is a real memory hog. I didn't
have any swap on my VM and gcc was failing for awhile there.
2. numpy using 'sudo apt-get install python-numpy' , 'pip install
python-numpy' seemed to worked but then 'make' failed
3. ImportError: No module named scipy: Try 'sudo apt-get install python-scipy'
4. ImportError: No module named pylon: Try 'sudo apt-get install
python-matplotlib'
5. I suspect there is more python dependencies, but I haven't worked
out that they all are yet.

Cheers,

Nathan


On 15 July 2011 14:55, Nathan K <[email protected]> wrote:
> G'day good people,
> I've spent a couple of days trying to get Ocropus working without much
> success. Any pointers would be greatly appreciated. I've tried to set
> it up following the default install instructions on an Ubuntu 10.10
> virtual box, and nativly on OSX. I've applied a variety of patchs
> (many tediously by hand) which has got me this far. Really keen to try
> out some of the fuctionality on my application. Many thanks in
> advance!
>
> #
> # Building ocroswig on osx
> # Fails: not sure exactly what the problem is here.
> #
>
> Admins-MacBook-Pro:ocroswig madteckhead$ makerm -rf *.so *.cxx *.o
> iulib.py ocropus.py *_wrap.cpp *_wrap.h *_wrap.cxx build *.pyc *.err
> *~
> python setup.py build
> running build
> running build_py
> file iulib.py (for module iulib) not found
> file ocropus.py (for module ocropus) not found
> file iulib.py (for module iulib) not found
> file ocropus.py (for module ocropus) not found
> running build_ext
> building '_iulib' extension
> swigging iulib.i to iulib_wrap.cpp
> swig -python -c++ -I/opt/local/include
> -I/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/numpy/core/include
> -o iulib_wrap.cpp iulib.i
> C compiler: /usr/bin/gcc-4.2 -fno-strict-aliasing -fno-common -dynamic
> -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes
>
> creating build
> creating build/temp.macosx-10.6-x86_64-2.6
> compile options: '-I/opt/local/include
> -I/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/numpy/core/include
> -I/opt/local/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6
> -c'
> gcc-4.2: iulib_wrap.cpp
> cc1plus: warning: command line option "-Wstrict-prototypes" is valid
> for C/ObjC but not for C++
> iulib_wrap.cpp: In function ‘void SWIG_Python_AddErrorMsg(const char*)’:
> iulib_wrap.cpp:870: warning: format not a string literal and no format 
> arguments
> iulib_wrap.cpp: In function ‘PyObject* _wrap_ustrg_at(PyObject*, PyObject*)’:
> iulib_wrap.cpp:39240: error: invalid initialization of reference of
> type ‘const int&’ from expression of type ‘colib::nuchar’
> /opt/local/include/colib/narray-util.h: In function ‘T
> colib::absmax(colib::narray<T>&) [with T = unsigned char]’:
> iulib_wrap.cpp:25443:   instantiated from here
> /opt/local/include/colib/narray-util.h:62: warning: comparison is
> always false due to limited range of data type
> /opt/local/include/colib/narray-util.h: In function ‘T
> colib::bat(colib::narray<T>&, int, U) [with T = float, U = float]’:
> iulib_wrap.cpp:28215:   instantiated from here
> /opt/local/include/colib/narray-util.h:338: warning: comparison
> between signed and unsigned integer expressions
> /opt/local/include/colib/narray-util.h: In function ‘T
> colib::bat(colib::narray<T>&, int, U) [with T = int, U = int]’:
> iulib_wrap.cpp:28270:   instantiated from here
> /opt/local/include/colib/narray-util.h:338: warning: comparison
> between signed and unsigned integer expressions
> /opt/local/include/colib/narray-util.h: In function ‘T
> colib::bat(colib::narray<T>&, int, U) [with T = unsigned char, U =
> unsigned char]’:
> iulib_wrap.cpp:28325:   instantiated from here
> /opt/local/include/colib/narray-util.h:338: warning: comparison
> between signed and unsigned integer expressions
> cc1plus: warning: command line option "-Wstrict-prototypes" is valid
> for C/ObjC but not for C++
> iulib_wrap.cpp: In function ‘void SWIG_Python_AddErrorMsg(const char*)’:
> iulib_wrap.cpp:870: warning: format not a string literal and no format 
> arguments
> iulib_wrap.cpp: In function ‘PyObject* _wrap_ustrg_at(PyObject*, PyObject*)’:
> iulib_wrap.cpp:39240: error: invalid initialization of reference of
> type ‘const int&’ from expression of type ‘colib::nuchar’
> /opt/local/include/colib/narray-util.h: In function ‘T
> colib::absmax(colib::narray<T>&) [with T = unsigned char]’:
> iulib_wrap.cpp:25443:   instantiated from here
> /opt/local/include/colib/narray-util.h:62: warning: comparison is
> always false due to limited range of data type
> /opt/local/include/colib/narray-util.h: In function ‘T
> colib::bat(colib::narray<T>&, int, U) [with T = float, U = float]’:
> iulib_wrap.cpp:28215:   instantiated from here
> /opt/local/include/colib/narray-util.h:338: warning: comparison
> between signed and unsigned integer expressions
> /opt/local/include/colib/narray-util.h: In function ‘T
> colib::bat(colib::narray<T>&, int, U) [with T = int, U = int]’:
> iulib_wrap.cpp:28270:   instantiated from here
> /opt/local/include/colib/narray-util.h:338: warning: comparison
> between signed and unsigned integer expressions
> /opt/local/include/colib/narray-util.h: In function ‘T
> colib::bat(colib::narray<T>&, int, U) [with T = unsigned char, U =
> unsigned char]’:
> iulib_wrap.cpp:28325:   instantiated from here
> /opt/local/include/colib/narray-util.h:338: warning: comparison
> between signed and unsigned integer expressions
> error: Command "/usr/bin/gcc-4.2 -fno-strict-aliasing -fno-common
> -dynamic -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes
> -I/opt/local/include
> -I/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/numpy/core/include
> -I/opt/local/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6
> -c iulib_wrap.cpp -o build/temp.macosx-10.6-x86_64-2.6/iulib_wrap.o"
> failed with exit status 1
> make: *** [setup] Error 1
>
>
> #
> # compile ocropy on osx
> #
>
> This does seem to work
>
> #
> # compile Python bindings for openfst
> # Fails: unable to find header files. I installed OpenFST 1.27 (from
> memory, or whatever the version on MacPorts is)
> #
>
> (ocr2)Admins-MacBook-Pro:pyopenfst madteckhead$ make
> python setup.py build
> running build
> running build_py
> copying openfst.py -> build/lib.macosx-10.6-x86_64-2.6
> running build_ext
> building '_openfst' extension
> swigging openfst.i to openfst_wrap.cpp
> swig -python -c++ -o openfst_wrap.cpp openfst.i
> openfst_properties.i:83: Warning(462): Unable to set dimensionless
> array variable
> /usr/bin/gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -O2
> -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes
> -I/opt/local/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6
> -c openfst_wrap.cpp -o
> build/temp.macosx-10.6-x86_64-2.6/openfst_wrap.o
> cc1plus: warning: command line option "-Wstrict-prototypes" is valid
> for C/ObjC but not for C++
> openfst_wrap.cpp:2619:24: error: fst/fstlib.h: No such file or directory
> openfst_wrap.cpp:2620:30: error: fst/symbol-table.h: No such file or directory
> openfst_wrap.cpp:2621:25: error: fst/arcsort.h: No such file or directory
> openfst_wrap.cpp:2622:24: error: fst/encode.h: No such file or directory
> openfst_wrap.cpp: In function ‘void SWIG_Python_AddErrorMsg(const char*)’:
> openfst_wrap.cpp:870: warning: format not a string literal and no
> format arguments
> openfst_wrap.cpp: At global scope:
> openfst_wrap.cpp:2623: error: ‘fst’ is not a namespace-name
> openfst_wrap.cpp:2623: error: expected namespace-name before ‘;’ token
> openfst_wrap.cpp:3061: error: ‘TropicalWeight’ does not name a type
> openfst_wrap.cpp:3068: error: expected initializer before ‘<’ token
> openfst_wrap.cpp:3074: error: expected initializer before ‘<’ token
> openfst_wrap.cpp:3077: error: expected initializer before ‘<’ token
> openfst_wrap.cpp:3079: error: expected initializer before ‘<’ token
> openfst_wrap.cpp:3080: error: expected initializer before ‘<’ token
> openfst_wrap.cpp:3082: error: expected initializer before ‘<’ token
> openfst_wrap.cpp:3083: error: expected initializer before ‘<’ token
> openfst_wrap.cpp:3085: error: expected initializer before ‘<’ token
> openfst_wrap.cpp:3086: error: expected initializer before ‘<’ token
> openfst_wrap.cpp:3088: error: expected initializer before ‘<’ token
> openfst_wrap.cpp:3089: error: expected initializer before ‘<’ token
> openfst_wrap.cpp:3091: error: expected initializer before ‘<’ token
> openfst_wrap.cpp:3092: error: expected initializer before ‘<’ token
> openfst_wrap.cpp:3094: error: expected initializer before ‘<’ token
> openfst_wrap.cpp:3095: error: expected initializer before ‘<’ token
> openfst_wrap.cpp:3097: error: expected initializer before ‘<’ token
> openfst_wrap.cpp:3098: error: expected initializer before ‘<’ token
> openfst_wrap.cpp:3100: error: expected initializer before ‘<’ token
> openfst_wrap.cpp:3101: error: expected initializer before ‘<’ token
> openfst_wrap.cpp:3103: error: expected initializer before ‘<’ token
> openfst_wrap.cpp:3104: error: expected initializer before ‘<’ token
> openfst_wrap.cpp:3106: error: expected initializer before ‘<’ token
> openfst_wrap.cpp:3107: error: expected initializer before ‘<’ token
> openfst_wrap.cpp:3109: error: expected initializer before ‘<’ token
> openfst_wrap.cpp:3110: error: expected initializer before ‘<’ token
> openfst_wrap.cpp:3294: error: ‘VectorFst’ was not declared in this scope
> openfst_wrap.cpp:3294: error: ‘StdArc’ was not declared in this scope
> openfst_wrap.cpp:3294: error: ‘self’ was not declared in this scope
> openfst_wrap.cpp:3294: error: expected primary-expression before ‘int’
> openfst_wrap.cpp:3294: error: initializer expression list treated as
> compound expression
> openfst_wrap.cpp:3294: error: expected ‘,’ or ‘;’ before ‘{’ token
> openfst_wrap.cpp:3297: error: ‘VectorFst’ was not declared in this scope
> openfst_wrap.cpp:3297: error: ‘StdArc’ was not declared in this scope
> openfst_wrap.cpp:3297: error: ‘self’ was not declared in this scope
> openfst_wrap.cpp:3297: error: expected primary-expression before ‘int’
> openfst_wrap.cpp:3297: error: initializer expression list treated as
> compound expression
> openfst_wrap.cpp:3297: error: expected ‘,’ or ‘;’ before ‘{’ token
> openfst_wrap.cpp:3300: error: variable or field
> ‘VectorFst_Sl_StdArc_Sg__SetNotFinal’ declared void
> openfst_wrap.cpp:3300: error: ‘VectorFst’ was not declared in this scope
> openfst_wrap.cpp:3300: error: ‘StdArc’ was not declared in this scope
> openfst_wrap.cpp:3300: error: ‘self’ was not declared in this scope
> openfst_wrap.cpp:3300: error: expected primary-expression before ‘int’
> openfst_wrap.cpp:3303: error: variable or field
> ‘VectorFst_Sl_StdArc_Sg__AddArc__SWIG_1’ declared void
> openfst_wrap.cpp:3303: error: ‘VectorFst’ was not declared in this scope
> openfst_wrap.cpp:3303: error: ‘StdArc’ was not declared in this scope
> openfst_wrap.cpp:3303: error: ‘self’ was not declared in this scope
> openfst_wrap.cpp:3303: error: expected primary-expression before ‘int’
> openfst_wrap.cpp:3303: error: expected primary-expression before ‘int’
> openfst_wrap.cpp:3303: error: expected primary-expression before ‘int’
> openfst_wrap.cpp:3303: error: expected primary-expression before ‘float’
> openfst_wrap.cpp:3303: error: expected primary-expression before ‘int’
> openfst_wrap.cpp:3306: error: expected initializer before ‘<’ token
> openfst_wrap.cpp:3311: error: ‘VectorFst’ was not declared in this scope
> openfst_wrap.cpp:3311: error: ‘StdArc’ was not declared in this scope
> openfst_wrap.cpp:3311: error: ‘self’ was not declared in this scope
> openfst_wrap.cpp:3311: error: expected primary-expression before ‘int’
> openfst_wrap.cpp:3311: error: expected primary-expression before ‘int’
> openfst_wrap.cpp:3311: error: initializer expression list treated as
> compound expression
> openfst_wrap.cpp:3311: error: expected ‘,’ or ‘;’ before ‘{’ token
> openfst_wrap.cpp:3316: error: ‘VectorFst’ was not declared in this scope
> openfst_wrap.cpp:3316: error: ‘StdArc’ was not declared in this scope
> openfst_wrap.cpp:3316: error: ‘self’ was not declared in this scope
> openfst_wrap.cpp:3316: error: expected primary-expression before ‘int’
> openfst_wrap.cpp:3316: error: expected primary-expression before ‘int’
> openfst_wrap.cpp:3316: error: initializer expression list treated as
> compound expression
> openfst_wrap.cpp:3316: error: expected ‘,’ or ‘;’ before ‘{’ token
> openfst_wrap.cpp:3321: error: ‘VectorFst’ was not declared in this scope
> openfst_wrap.cpp:3321: error: ‘StdArc’ was not declared in this scope
> openfst_wrap.cpp:3321: error: ‘self’ was not declared in this scope
> openfst_wrap.cpp:3321: error: expected primary-expression before ‘int’
> openfst_wrap.cpp:3321: error: expected primary-expression before ‘int’
> openfst_wrap.cpp:3321: error: initializer expression list treated as
> compound expression
> openfst_wrap.cpp:3321: error: expected ‘,’ or ‘;’ before ‘{’ token
> openfst_wrap.cpp:3326: error: ‘VectorFst’ was not declared in this scope
> openfst_wrap.cpp:3326: error: ‘StdArc’ was not declared in this scope
> openfst_wrap.cpp:3326: error: ‘self’ was not declared in this scope
> openfst_wrap.cpp:3326: error: expected primary-expression before ‘int’
> openfst_wrap.cpp:3326: error: expected primary-expression before ‘int’
> openfst_wrap.cpp:3326: error: initializer expression list treated as
> compound expression
> openfst_wrap.cpp:3326: error: expected ‘,’ or ‘;’ before ‘{’ token
> openfst_wrap.cpp:3334: error: variable or field
> ‘VectorFst_Sl_StdArc_Sg__AddString__SWIG_0’ declared void
> openfst_wrap.cpp:3334: error: ‘VectorFst’ was not declared in this scope
> openfst_wrap.cpp:3334: error: ‘StdArc’ was not declared in this scope
> openfst_wrap.cpp:3334: error: ‘self’ was not declared in this scope
> openfst_wrap.cpp:3334: error: expected primary-expression before ‘char’
> openfst_wrap.cpp:3334: error: expected primary-expression before ‘float’
> openfst_wrap.cpp:3334: error: expected primary-expression before ‘float’
> openfst_wrap.cpp:3334: error: expected primary-expression before ‘float’
> error: command '/usr/bin/gcc-4.2' failed with exit status 1
> make: *** [install] Error 1
>
> #
> # Building OpenFST 1.1 on ubuntu 10.10 causes GCC 4.4 to fail. It also
> generally become extreamly unresponsive to the point the GUI becomes
> unresponsive and I must restart. Thus I'm  not getting any useful
> debug messages.
> #
>
>
> --
> Email: nathank [at] noshly.com (professional)
> Email: its [at] madteckhead.com (personal)
> Website: http://www.madteckhead.com
>
> --------------------------------------------
> Q: Why is this email five sentences or less?
> A: http://five.sentenc.es
>
> This email (including any attachments) is confidential and may be
> privileged. If you have received it in error, please notify the sender
> by return email and delete this message from your system. Any
> unauthorised use or dissemination of this message in whole or in part
> is strictly prohibited. Please note that emails are susceptible to
> change and we will not be liable for the improper or incomplete
> transmission of the information contained in this communication nor
> for any delay in its receipt or damage to your system. We do not
> guarantee that the integrity of this communication has been maintained
> nor that this communication is free of viruses, interceptions or
> interference.
>



-- 
Email: nathank [at] noshly.com (professional)
Email: its [at] madteckhead.com (personal)
Website: http://www.madteckhead.com

--------------------------------------------
Q: Why is this email five sentences or less?
A: http://five.sentenc.es

This email (including any attachments) is confidential and may be
privileged. If you have received it in error, please notify the sender
by return email and delete this message from your system. Any
unauthorised use or dissemination of this message in whole or in part
is strictly prohibited. Please note that emails are susceptible to
change and we will not be liable for the improper or incomplete
transmission of the information contained in this communication nor
for any delay in its receipt or damage to your system. We do not
guarantee that the integrity of this communication has been maintained
nor that this communication is free of viruses, interceptions or
interference.

-- 
You received this message because you are subscribed to the Google Groups 
"ocropus" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/ocropus?hl=en.

Reply via email to