Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: Unrecognized keyword arguments passed to Dense #255

Open
PythoneerSamurai opened this issue Aug 2, 2024 · 5 comments
Open

Comments

@PythoneerSamurai
Copy link

I've tried to make a keras_ocr.pipeline.Pipeline() object both on my local machine and cloud notebook, and I'm getting the error mentioned in the title of this issue. I have tensorflow > 2.0.0, as mentioned on the GitHub page. How to fix this? Another point to be noted is that I opened a very old notebook from a youtuber, it was using tensorflow 2.6.4, and keras_ocr was working properly there. However, I cannot install that version of tensorflow as pip does not recognize it, probably because it is not compatible with newer versions of python.

@vigneshwarvenkat
Copy link

Had the same issue, but the fix specified on #252 works for me.

tensorflow==2.13.0
keras==2.13.1
keras-ocr==0.9.3

@PythoneerSamurai
Copy link
Author

PythoneerSamurai commented Aug 5, 2024

Had the same issue, but the fix specified on #252 works for me.

tensorflow==2.13.0 keras==2.13.1 keras-ocr==0.9.

Thankyou, I installed your versions of tensorflow, keras, and keras-ocr. Now my code is running.

@Deependrashukla
Copy link

had the same issue and fixed it by installing this version in colab.
!pip install tensorflow==2.15

@smathieson
Copy link

This is useful, but are there any plans for updating and supporting keras3?

@t-wolfeadam
Copy link

FYI since TF 2.15 is not compatible with python 3.12+, what I did to fix it was change L277:282 in recognition.py to:

locnet_y = keras.layers.Dense(
            6,
            kernel_initializer=tf.constant_initializer(np.zeros((64, 6), dtype="float32")),
            bias_initializer=tf.constant_initializer(np.array([[1, 0, 0], [0, 1, 0]], dtype="float32").flatten()),
        )(locnet_y)

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

No branches or pull requests

5 participants