ANPR-Tensorflow
ANPR-Tensorflow copied to clipboard
ValueError: setting an array element with a sequence.
After i fixed issue #3 when i run the train.py i get the following error
Traceback (most recent call last): File "train.py", line 250, in <module> initial_weights=initial_weights) File "train.py", line 220, in train do_batch() File "train.py", line 203, in do_batch feed_dict={x: batch_xs, y_: batch_ys}) File "/usr/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 929, in run run_metadata_ptr) File "/usr/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1121, in _run np_val = np.asarray(subfeed_val, dtype=subfeed_dtype) File "/usr/lib64/python3.6/site-packages/numpy/core/numeric.py", line 538, in asarray return array(a, dtype, copy=False, order=order) ValueError: setting an array element with a sequence
can someone help me out?
Hi @jihadbourassi , Me too, I am blocked by this error, if I have found a solution I will share it with you...
Hi, I think that I resolved the problem!
Searching in the web, I understood that this problem is caused because the Dense Connected Layer is too big, and it is breaking the GPU. So, I reduced the size of the layer to 32 * 8 * 128, 1024
.
This is the code that I have changed in the models.py
file:
Starts on line 106
W_fc1 = weight_variable([32 * 8 * 128, 1024])
b_fc1 = bias_variable([1024])
conv_layer_flat = tf.reshape(conv_layer, [-1, 32 * 8 * 128])
h_fc1 = tf.nn.relu(tf.matmul(conv_layer_flat, W_fc1) + b_fc1)
# Output layer
W_fc2 = weight_variable([1024, 1 + 7 * len(common.CHARS)])
b_fc2 = bias_variable([1 + 7 * len(common.CHARS)])