1、运行train_tassdata后的第一个问题:
language_combobox_changed Started
Exception in thread Thread-3:
Traceback (most recent call last):
File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
self.run()
File "/usr/lib/python3.6/threading.py", line 864, in run
self._target(*self._args, **self._kwargs)
File "/usr/lib/python3/dist-packages/lios/train_tesseract.py", line 643, in language_combobox_changed
self.output_terminal.run_command(cmd)
File "/usr/lib/python3/dist-packages/lios/ui/gtk/terminal.py", line 48, in run_command
self.feed_child(command, length)
TypeError: Vte.Terminal.feed_child() takes exactly 2 arguments (3 given)
经过多次重装系统,排查该问题的原因后,发现主要原因是使用 sudo apt upgrade 后造成 gir1.2-vte-2.91这个软件包升级后就会遇到如上错误信息,解决办法如下:
将gir1.2-vte-2.91 这个软件包降级或者提前锁定为0.52.1-1ubuntu1 这个版本即可。
2、在编译安装tesseract-ocr的源码包后遇到如下问题:
(lios:19607): Gtk-WARNING **: 23:58:52.428: Cannot connect attribute 'text' for cell renderer class 'lios+ui+gtk+tree_view+CellRendererToggle' since attribute does not exist
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/lios/main.py", line 1329, in make_preferences_effective
self.dict = dictionary.Dict(dictionary.dictionary_language_dict[languages[self.preferences.language]])
IndexError: list index out of range
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/bin/lios", line 8, in
linux_intelligent_ocr_solution()
File "/usr/local/lib/python3.6/dist-packages/lios/main.py", line 342, in init
self.make_preferences_effective()
File "/usr/local/lib/python3.6/dist-packages/lios/main.py", line 1350, in make_preferences_effective
pacman -S aspell-fr""").format(languages[self.preferences.language]))
IndexError: list index out of range`
目前还没有查找到其问题根源,解决办法是:
在从源码安装tesseract-ocr的时候,使用如下命令将其安装到普通用户目录下:
git clone https://github.com/tesseract-ocr/tesseract.git tesseract-ocr
cd tesseract-ocr
./autogen.sh
./configure --prefix=$HOME/local/
make
make install
make training
make training-install