Voici le lien vers mon code complet:Imprimer la valeur d'un tenseur dans tensorflow
https://github.com/roshanDD/YAD2K/blob/master/yad2k/models/keras_yolo.py#L253
Je veux juste imprimer la valeur du tenseur, appelé true_areas
. J'ai couru mon code:
sess = tf.InteractiveSession()
true_areas = true_wh[..., 0] * true_wh[..., 1]
tf.Print(true_areas, [true_areas], message = "This is True Areas: ")
b = tf.add(true_areas, true_areas).eval()
Mais il me donne l'erreur:
Caused by op 'input_2', defined at:
File "learning.py", line 358, in <module>
_main(args)
File "learning.py", line 66, in _main
model_body, model = create_model(anchors, class_names)
File "learning.py", line 185, in create_model
boxes_input = Input(shape=(None, 5))
File "/home/ubuntu/anaconda2/envs/py35/lib/python3.5/site-packages/keras/engine/topology.py", line 1388, in Input
input_tensor=tensor)
File "/home/ubuntu/anaconda2/envs/py35/lib/python3.5/site-packages/keras/engine/topology.py", line 1299, in __init__
name=self.name)
File "/home/ubuntu/anaconda2/envs/py35/lib/python3.5/site-packages/keras/backend/tensorflow_backend.py", line 349, in placeholder
x = tf.placeholder(dtype, shape=shape, name=name)
File "/home/ubuntu/anaconda2/envs/py35/lib/python3.5/site-packages/tensorflow/python/ops/array_ops.py", line 1507, in placeholder
name=name)
File "/home/ubuntu/anaconda2/envs/py35/lib/python3.5/site-packages/tensorflow/python/ops/gen_array_ops.py", line 1997, in _placeholder
name=name)
File "/home/ubuntu/anaconda2/envs/py35/lib/python3.5/site-packages/tensorflow/python/framework/op_def_library.py", line 768, in apply_op
op_def=op_def)
File "/home/ubuntu/anaconda2/envs/py35/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 2336, in create_op
original_op=self._default_original_op, op_def=op_def)
File "/home/ubuntu/anaconda2/envs/py35/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 1228, in __init__
self._traceback = _extract_stack()
InvalidArgumentError (see above for traceback): You must feed a value for placeholder tensor 'input_2' with dtype float
[[Node: input_2 = Placeholder[dtype=DT_FLOAT, shape=[], _device="/job:localhost/replica:0/task:0/cpu:0"]()]]
Qu'est-ce que l'espace réservé, il parle?
pouvez-vous s'il vous plaît ajouter le code complet? la stacktrace ne correspond à rien de ce que vous avez fourni en termes de code. (tout apprentissage.py serait un bon début) –
https://github.com/roshanDD/YAD2K/blob/master/yad2k/models/keras_yolo.py#L253 – user3222184
Learning.py est ici: https: // github .com/roshanDD/YAD2K/blob/master/learning.py – user3222184