RealTime-DigitRecognition
RealTime-DigitRecognition copied to clipboard
Specify the correct versions of used packages or update the code
Hi! I've tried to run your code, and there were 3 errors that I had to fix before it worked successfully.
-
Error: File "anaconda3/lib/python3.7/site-packages/tensorflow/python/keras/utils/generic_utils.py", line 325, in class_and_config_for_serialized_keras_object for key, item in cls_config.items(): AttributeError: 'list' object has no attribute 'items' Please, specify the correct version of TensorFlow. For me, it didn't work with TF version 2.2.0 but successfully worked with TF version 1.15.0 Solution: use TF 1.x
-
Error: File "RealTime-DigitRecognition/process_image.py", line 6, in
from keras.models import load_model ModuleNotFoundError: No module named 'keras' Solution: modify file process_image.py line 6 to from tensorflow.keras.models import load_model
-
Error: File "RealTime-DigitRecognition/process_image.py", line 59, in get_output_image im2,contours,hierarchy = cv2.findContours(thresh, cv2.RETR_CCOMP, cv2.CHAIN_APPROX_SIMPLE) ValueError: not enough values to unpack (expected 3, got 2) This is from the new version of OpenCV. I use cv2 version 4.3.0, and cv2.findContours returns 2 arguments instead of 3. Probably specifying the correct version for OpenCV would also be useful. Solution: modify line 59 in the file process_image.py to
contours,hierarchy = cv2.findContours(thresh, cv2.RETR_CCOMP, cv2.CHAIN_APPROX_SIMPLE)
.
Great utility, thanks!
Thanks @ViktoriiaBaib for suggestions. Create a merge request I will test/review and merge with my code.