Installing keras-ocr on jetson nano

Hello,

I am trying to install keras-ocr on jetson nano.
I get the following error:

ERROR: Could not find a version that satisfies the requirement opencv-python (from imgaug->keras-ocr) (from versions: none)
ERROR: No matching distribution found for opencv-python (from imgaug->keras-ocr)

So i tried to install the imgaug separately using python3 -m pip install imgaug

ERROR: Could not find a version that satisfies the requirement opencv-python (from imgaug) (from versions: none)
ERROR: No matching distribution found for opencv-python (from imgaug)

I get a similar error.
Since Opencv, CUDA and cudnn is already installed along with the jetpack4.4.
For verifying if opencv is installed…
import cv2
cv2.version # got 4.1.1

I used the steps mentioned in [How to configure your NVIDIA Jetson Nano for Computer Vision and Deep Learning - PyImageSearch] and upgraded it to 4.1.2 and still getting the same error.

While upgrading it to 4.1.2 the cmake cmd showed
cudnn : NO

On doing python3 -m pip install opencv-python
Defaulting to user installation because normal site-packages is not writeable
ERROR: Could not find a version that satisfies the requirement opencv-python (from versions: none)
ERROR: No matching distribution found for opencv-python

On doing python3 -m pip uninstall opencv-python
WARNING: Skipping opencv-python as it is not installed.

but i am able to import cv2.

Since Opencv(4.1.1), CUDA(10.2),cudnn(8) is said to installed already in the jetpack4.4, then why such issues are coming.
Can someone guide on this.

Hi,

Does the error occur when you try to install keras-ocr via pip3?
If yes, you can install it with --no-dependencies.

Since the OpenCV is pre-installed on the Jetson Nano, it should be okay to skip it.
Thanks.

Hello,
Yes with pip3 also its the same.
I tried --no-dependencies, keras-ocr is installed but on importing i am getting error.

import keras_ocr
2020-08-07 15:56:24.416966: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcudart.so.10.2
Traceback (most recent call last):
File “”, line 1, in
File “/home/kanishka/.local/lib/python3.6/site-packages/keras_ocr/init.py”, line 1, in
from . import (detection, recognition, tools, data_generation, pipeline, evaluation, datasets)
File “/home/kanishka/.local/lib/python3.6/site-packages/keras_ocr/detection.py”, line 31, in
from . import tools
File “/home/kanishka/.local/lib/python3.6/site-packages/keras_ocr/tools.py”, line 10, in
import imgaug
File “/home/kanishka/.local/lib/python3.6/site-packages/imgaug/init.py”, line 9, in
import imgaug.augmentables as augmentables
File “/home/kanishka/.local/lib/python3.6/site-packages/imgaug/augmentables/init.py”, line 8, in
from imgaug.augmentables.segmaps import *
File “/home/kanishka/.local/lib/python3.6/site-packages/imgaug/augmentables/segmaps.py”, line 12, in
from …augmenters import blend as blendlib
File “/home/kanishka/.local/lib/python3.6/site-packages/imgaug/augmenters/init.py”, line 21, in
from imgaug.augmenters.segmentation import *
File “/home/kanishka/.local/lib/python3.6/site-packages/imgaug/augmenters/segmentation.py”, line 21, in
import skimage.segmentation
File “/usr/local/lib/python3.6/dist-packages/skimage/segmentation/init.py”, line 2, in
from .active_contour_model import active_contour
File “/usr/local/lib/python3.6/dist-packages/skimage/segmentation/active_contour_model.py”, line 5, in
from …filters import sobel
File “/usr/local/lib/python3.6/dist-packages/skimage/filters/init.py”, line 18, in
from .ridges import (meijering, sato, frangi, hessian)
File “/usr/local/lib/python3.6/dist-packages/skimage/filters/ridges.py”, line 18, in
from …feature.corner import hessian_matrix, hessian_matrix_eigvals
File “/usr/local/lib/python3.6/dist-packages/skimage/feature/init.py”, line 4, in
from ._cascade import Cascade
ImportError: /usr/lib/aarch64-linux-gnu/libgomp.so.1: cannot allocate memory in static TLS block

Hi,

Sorry for the late update.
The new error is related to the library header.
https://github.com/opencv/opencv/issues/14884#issuecomment-599852128

Would you mind to import the openCV library before TensorFlow and see if this works?

import cv2
import keras_ocr

Thanks.