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: setting an array element with a sequence. #4

Open
jihadbourassi opened this issue Mar 15, 2019 · 2 comments
Open

ValueError: setting an array element with a sequence. #4

jihadbourassi opened this issue Mar 15, 2019 · 2 comments

Comments

@jihadbourassi
Copy link

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?

@bensedik
Copy link

Hi @jihadbourassi ,
Me too, I am blocked by this error, if I have found a solution I will share it with you...

@JoaoGabrielM
Copy link

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)])

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

3 participants