cqu-isse/CARLCS-CNN

ValueError: logits and labels must have the same shape

Opened this issue · 1 comments

I have the following problem when I run the solution for this job, can you help me?

Traceback (most recent call last):
File "main.py", line 330, in
model.compile(optimizer=optimizer)
File "/home/usuario/projetos/CARLCS-CNN/CARLCS-CNN/models.py", line 244, in compile
self._sim_model.compile(loss='binary_crossentropy', optimizer=optimizer, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/keras/engine/training.py", line 899, in compile
sample_weight, mask)
File "/usr/local/lib/python2.7/dist-packages/keras/engine/training.py", line 430, in weighted
score_array = fn(y_true, y_pred)
File "/usr/local/lib/python2.7/dist-packages/keras/losses.py", line 45, in binary_crossentropy
return K.mean(K.binary_crossentropy(y_pred, y_true), axis=-1)
File "/usr/local/lib/python2.7/dist-packages/keras/backend/tensorflow_backend.py", line 2617, in binary_crossentropy
logits=output)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/nn_impl.py", line 168, in sigmoid_cross_entropy_with_logits
(logits.get_shape(), labels.get_shape()))
ValueError: logits and labels must have the same shape ((?, 100, 100) vs (?, ?))

Same thing happens for python version 3.6

Traceback (most recent call last):
File "main.py", line 330, in
model.compile(optimizer=optimizer)
File "/home/usuario/projetos/CARLCS-CNN/CARLCS-CNN/models.py", line 244, in compile
self._sim_model.compile(loss='binary_crossentropy', optimizer=optimizer, **kwargs)
File "/home/usuario/projetos/CARLCS-CNN/CARLCS-CNN/virtualenv/lib/python3.6/site-packages/keras/engine/training.py", line 899, in compile
sample_weight, mask)
File "/home/usuario/projetos/CARLCS-CNN/CARLCS-CNN/virtualenv/lib/python3.6/site-packages/keras/engine/training.py", line 430, in weighted
score_array = fn(y_true, y_pred)
File "/home/usuario/projetos/CARLCS-CNN/CARLCS-CNN/virtualenv/lib/python3.6/site-packages/keras/losses.py", line 45, in binary_crossentropy
return K.mean(K.binary_crossentropy(y_pred, y_true), axis=-1)
File "/home/usuario/projetos/CARLCS-CNN/CARLCS-CNN/virtualenv/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 2617, in binary_crossentropy
logits=output)
File "/home/usuario/projetos/CARLCS-CNN/CARLCS-CNN/virtualenv/lib/python3.6/site-packages/tensorflow/python/ops/nn_impl.py", line 168, in sigmoid_cross_entropy_with_logits
(logits.get_shape(), labels.get_shape()))
ValueError: logits and labels must have the same shape ((?, 100, 100) vs (?, ?))