Skip to content

Finishing out fixing size bug#1

Open
jamgochiana wants to merge 2 commits intojavvi51:masterfrom
jamgochiana:master
Open

Finishing out fixing size bug#1
jamgochiana wants to merge 2 commits intojavvi51:masterfrom
jamgochiana:master

Conversation

@jamgochiana
Copy link

Updating how largest-sized boxes are found given sizes are no longer stored in the rect_list. (Finishing 'fixed size bug' workflow :))

@gowthamgdn
Copy link

while executing the above code i am getting lot of error's after solving also. can, anyone help me out

@Karl-FC
Copy link

Karl-FC commented Sep 2, 2024

Same here. I've been getting this AttributeError even with the other versions.

This is when I used the above code from the Pull request:

PS D:\Files\Da Documents\Programming\eDOCr> python "D:\Files\Da Documents\Programming\eDOCr\eDOCr\ocr_it.py" "D:\Files\Da Documents\Programming\FINAL-PROJECT.pdf"
2024-09-02 11:14:46.292089: I tensorflow/core/util/port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable TF_ENABLE_ONEDNN_OPTS=0.
2024-09-02 11:14:47.990900: I tensorflow/core/util/port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable TF_ENABLE_ONEDNN_OPTS=0.
Looking for C:\Users\K.keras-ocr\recognizer_infoblock.h5
Looking for C:\Users\K.keras-ocr\recognizer_dimensions.h5
Looking for C:\Users\K.keras-ocr\recognizer_gdts.h5

Traceback (most recent call last):
File "D:\Files\Da Documents\Programming\eDOCr\eDOCr\ocr_it.py", line 85, in
class_list, img_boxes=tools.box_tree.findrect(img)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\K\AppData\Roaming\Python\Python312\site-packages\eDOCr\tools\box_tree.py", line 173, in findrect
class_list.append(rect('rect_'+str(r),x,y,w,h,size,crop_img,'green')) #Get a list with the rect class
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\K\AppData\Roaming\Python\Python312\site-packages\eDOCr\tools\box_tree.py", line 32, in init
self.size = size
^^^^^^^^^
AttributeError: property 'size' of 'rect' object has no setter`

This one is when I used the latest code:

`PS D:\Files\Da Documents\Programming\eDOCr> python "D:\Files\Da Documents\Programming\eDOCr\eDOCr\ocr_it.py" "D:\Files\Da Documents\Programming\FINAL-PROJECT.pdf"

2024-09-02 11:18:58.064950: I tensorflow/core/util/port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable TF_ENABLE_ONEDNN_OPTS=0.
2024-09-02 11:18:59.628041: I tensorflow/core/util/port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable TF_ENABLE_ONEDNN_OPTS=0.
Looking for C:\Users\K.keras-ocr\recognizer_infoblock.h5
Looking for C:\Users\K.keras-ocr\recognizer_dimensions.h5
Looking for C:\Users\K.keras-ocr\recognizer_gdts.h5
Traceback (most recent call last):
File "D:\Files\Da Documents\Programming\eDOCr\eDOCr\ocr_it.py", line 85, in
class_list, img_boxes=tools.box_tree.findrect(img)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\K\AppData\Roaming\Python\Python312\site-packages\eDOCr\tools\box_tree.py", line 173, in findrect
class_list.append(rect('rect_'+str(r),x,y,w,h,size,crop_img,'green')) #Get a list with the rect class
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\K\AppData\Roaming\Python\Python312\site-packages\eDOCr\tools\box_tree.py", line 32, in init
self.size = size
^^^^^^^^^
AttributeError: property 'size' of 'rect' object has no setter`

I'm still a beginner on this so any kind of help would be appreciated. Thanks!

@lokeshkoushal
Copy link

(py310) C:\Users\Lokesh Koushal\Desktop\eDOCr\eDOCr-master\tests>python train.py
[]
Traceback (most recent call last):
File "C:\Users\Lokesh Koushal\Desktop\eDOCr\eDOCr-master\tests\train.py", line 28, in
for i in os.listdir(os.path.join(DIR,'eDOCr/Keras_OCR_models/fonts')):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'C:\Users\Lokesh Koushal\Desktop\eDOCr\eDOCr-master\tests\eDOCr/Keras_OCR_models/fonts'

(py310) C:\Users\Lokesh Koushal\Desktop\eDOCr\eDOCr-master\tests>python train.py
File "C:\Users\Lokesh Koushal\Desktop\eDOCr\eDOCr-master\tests\train.py", line 9
recognizer_basepath = os.path.join(DIR,'C:\Users\Lokesh Koushal\Desktop\eDOCr\eDOCr-master\eDOCr\keras_ocr_models\fonts')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape

(py310) C:\Users\Lokesh Koushal\Desktop\eDOCr\eDOCr-master\tests>python train.py
[]
Traceback (most recent call last):
File "C:\Users\Lokesh Koushal\Desktop\eDOCr\eDOCr-master\tests\train.py", line 28, in
for i in os.listdir(os.path.join(DIR,'eDOCr/Keras_OCR_models/fonts')):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'C:\Users\Lokesh Koushal\Desktop\eDOCr\eDOCr-master\tests\eDOCr/Keras_OCR_models/fonts'

(py310) C:\Users\Lokesh Koushal\Desktop\eDOCr\eDOCr-master\tests>python train.py
[]
Traceback (most recent call last):
File "C:\Users\Lokesh Koushal\Desktop\eDOCr\eDOCr-master\tests\train.py", line 34, in
raise FileNotFoundError(f"Fonts directory not found: {fonts_dir}")
FileNotFoundError: Fonts directory not found: C:\Users\Lokesh Koushal\Desktop\eDOCr\eDOCr-master\tests\eDOCr\keras_ocr_models\fonts

(py310) C:\Users\Lokesh Koushal\Desktop\eDOCr\eDOCr-master\tests>python train.py
[]
Traceback (most recent call last):
File "C:\Users\Lokesh Koushal\Desktop\eDOCr\eDOCr-master\tests\train.py", line 28, in
for i in os.listdir(os.path.join(DIR,'eDOCr/Keras_OCR_models/fonts')):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'C:\Users\Lokesh Koushal\Desktop\eDOCr\eDOCr-master\tests\eDOCr/Keras_OCR_models/fonts'

(py310) C:\Users\Lokesh Koushal\Desktop\eDOCr\eDOCr-master\tests>python train.py
[]
WARNING:tensorflow:From C:\Users\Lokesh Koushal\AppData\Roaming\Python\Python312\site-packages\keras\src\backend\tensorflow\core.py:216: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead.

2025-01-16 13:20:50.919268: I tensorflow/core/platform/cpu_feature_guard.cc:210] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
Traceback (most recent call last):
File "C:\Users\Lokesh Koushal\Desktop\eDOCr\eDOCr-master\tests\train.py", line 34, in
train_recognizer.generate_n_train(alphabet,backgrounds,fonts,recognizer_basepath=recognizer_basepath, pretrained_model=pretrained_model)
File "C:\Users\Lokesh Koushal\AppData\Roaming\Python\Python312\site-packages\eDOCr\keras_ocr_models\train_recognizer.py", line 76, in generate_n_train
recognizer = keras_ocr.recognition.Recognizer(alphabet=alphabet)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Lokesh Koushal\AppData\Roaming\Python\Python312\site-packages\eDOCr\keras_ocr\recognition.py", line 388, in init
) = build_model(alphabet=alphabet, **build_params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Lokesh Koushal\AppData\Roaming\Python\Python312\site-packages\eDOCr\keras_ocr\recognition.py", line 277, in build_model
locnet_y = keras.layers.Dense(
^^^^^^^^^^^^^^^^^^^
File "C:\Users\Lokesh Koushal\AppData\Roaming\Python\Python312\site-packages\keras\src\layers\core\dense.py", line 87, in init
super().init(activity_regularizer=activity_regularizer, **kwargs)
File "C:\Users\Lokesh Koushal\AppData\Roaming\Python\Python312\site-packages\keras\src\layers\layer.py", line 287, in init
raise ValueError(
ValueError: Unrecognized keyword arguments passed to Dense: {'weights': [array([[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.]], dtype=float32), array([1., 0., 0., 0., 1., 0.], dtype=float32)]}
solve this errror and not run this code please help me

@lokeshkoushal
Copy link

(edocr2) C:\Users\Lokesh Koushal\Desktop\eDOCr-1.0.0\tests>python test_drawing.py
Traceback (most recent call last):
File "C:\Users\Lokesh Koushal\Desktop\eDOCr-1.0.0\tests\test_drawing.py", line 28, in
class_list, img_boxes=tools.box_tree.findrect(img)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Lokesh Koushal.conda\envs\edocr2\Lib\site-packages\eDOCr\tools\box_tree.py", line 173, in findrect
class_list.append(rect('rect_'+str(r),x,y,w,h,size,crop_img,'green')) #Get a list with the rect class
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Lokesh Koushal.conda\envs\edocr2\Lib\site-packages\eDOCr\tools\box_tree.py", line 32, in init
self.size = size
^^^^^^^^^
AttributeError: property 'size' of 'rect' object has no setter

(edocr2) C:\Users\Lokesh Koushal\Desktop\eDOCr-1.0.0\tests>

please sir help this error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants