RealTime-DigitRecognition icon indicating copy to clipboard operation
RealTime-DigitRecognition copied to clipboard

Specify the correct versions of used packages or update the code

Open ViktoriiaBaib opened this issue 4 years ago • 1 comments

Hi! I've tried to run your code, and there were 3 errors that I had to fix before it worked successfully.

  1. 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

  2. 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

  3. 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!

ViktoriiaBaib avatar Jul 10 '20 15:07 ViktoriiaBaib

Thanks @ViktoriiaBaib for suggestions. Create a merge request I will test/review and merge with my code.

surya-veer avatar Jul 10 '20 15:07 surya-veer