dwieker / DigitClassifier

Scan and digitize a table of handwritten digits
4 stars 1 forks source link

AttributeError: 'list' object has no attribute 'min' #1

Closed saurabhbidwai closed 6 years ago

saurabhbidwai commented 6 years ago

save_segmented_img("E:/Shezartech/OCR/Vietnamese/vietnamese-alphabet-146.jpeg") C:\Users\DELL\Anaconda3\lib\site-packages\skimage\transform_warps.py:84: UserWarning: The default mode, 'constant', will be changed to 'reflect' in skimage 0.15. warn("The default mode, 'constant', will be changed to 'reflect' in " C:\Users\DELL\Anaconda3\lib\site-packages\keras\engine\base_layer.py:1109: UserWarning: Update your Conv2D call to the Keras 2 API: Conv2D(name="convolution2d_1", activity_regularizer=None, trainable=True, input_dtype="float32", batch_input_shape=[None, 1, ..., activation="linear", kernel_size=(3, 3), filters=32, strides=[1, 1], padding="valid", data_format="channels_first", kernel_initializer="glorot_uniform", kernel_regularizer=None, bias_regularizer=None, kernel_constraint=None, bias_constraint=None, use_bias=True) return cls(config) C:\Users\DELL\Anaconda3\lib\site-packages\keras\engine\base_layer.py:1109: UserWarning: Update your Conv2D call to the Keras 2 API: Conv2D(name="convolution2d_2", activity_regularizer=None, trainable=True, activation="linear", kernel_size=(3, 3), filters=32, strides=[1, 1], padding="valid", data_format="channels_first", kernel_initializer="glorot_uniform", kernel_regularizer=None, bias_regularizer=None, kernel_constraint=None, bias_constraint=None, use_bias=True) return cls(config) C:\Users\DELL\Anaconda3\lib\site-packages\keras\engine\base_layer.py:1109: UserWarning: Update your MaxPooling2D call to the Keras 2 API: MaxPooling2D(name="maxpooling2d_1", trainable=True, pool_size=[2, 2], strides=[2, 2], padding="valid", data_format="channels_first") return cls(config) C:\Users\DELL\Anaconda3\lib\site-packages\keras\engine\base_layer.py:1109: UserWarning: Update your Dropout call to the Keras 2 API: Dropout(trainable=True, name="dropout_1", rate=0.25) return cls(config) C:\Users\DELL\Anaconda3\lib\site-packages\keras\engine\base_layer.py:1109: UserWarning: Update your Dense call to the Keras 2 API: Dense(name="dense_1", activity_regularizer=None, trainable=True, input_dim=None, activation="linear", units=128, kernel_initializer="glorot_uniform", kernel_regularizer=None, bias_regularizer=None, kernel_constraint=None, bias_constraint=None, use_bias=True) return cls(config) pad_width must be of integral type. pad_width must be of integral type. pad_width must be of integral type. pad_width must be of integral type. pad_width must be of integral type. pad_width must be of integral type. pad_width must be of integral type. pad_width must be of integral type. pad_width must be of integral type. pad_width must be of integral type. pad_width must be of integral type. pad_width must be of integral type. pad_width must be of integral type. pad_width must be of integral type. pad_width must be of integral type. pad_width must be of integral type. pad_width must be of integral type. pad_width must be of integral type. pad_width must be of integral type. pad_width must be of integral type. pad_width must be of integral type. pad_width must be of integral type. pad_width must be of integral type. pad_width must be of integral type. pad_width must be of integral type. pad_width must be of integral type. pad_width must be of integral type. pad_width must be of integral type. pad_width must be of integral type. C:\Users\DELL\Anaconda3\lib\site-packages\keras\engine\base_layer.py:1109: UserWarning: Update your Dropout call to the Keras 2 API: Dropout(trainable=True, name="dropout_2", rate=0.5) return cls(config) C:\Users\DELL\Anaconda3\lib\site-packages\keras\engine\base_layer.py:1109: UserWarning: Update your Dense call to the Keras 2 API: Dense(name="dense_2", activity_regularizer=None, trainable=True, input_dim=None, activation="linear", units=10, kernel_initializer="glorot_uniform", kernel_regularizer=None, bias_regularizer=None, kernel_constraint=None, bias_constraint=None, use_bias=True) return cls(**config) Traceback (most recent call last):

File "", line 1, in save_segmented_img("E:/Shezartech/OCR/Vietnamese/vietnamese-alphabet-146.jpeg")

File "", line 93, in save_segmented_img coords, probs = scan_image(im)

File "", line 80, in scan_image y_pred = keras.predict_proba(X, verbose=0)

File "C:\Users\DELL\Anaconda3\lib\site-packages\keras\engine\sequential.py", line 246, in predict_proba if preds.min() < 0. or preds.max() > 1.:

AttributeError: 'list' object has no attribute 'min'

saurabhbidwai commented 6 years ago

Pad the image CHANGE TO // for Python3, / for Python2

wpad = (28 - w)//2 hpad = (28 - h)//2