klauspa / Yolov4-tensorflow

tensorflow implementation for Yolo v4
60 stars 23 forks source link

When using data tensors as input to a model, you should specify the `steps` argument. #5

Open qiumei1101 opened 4 years ago

qiumei1101 commented 4 years ago

When using data tensors as input to a model, you should specify the steps argument.?

klauspa commented 4 years ago

Now the code is only for inference, steps argument is needed when training in the case that data tensors is repeated.

pmikas commented 4 years ago

I am having the same error for inference. Do you know where the problem might be?

Traceback (most recent call last): File "detect.py", line 42, in <module> pred_bbox = model.predict(img_tensor) File "C:\Users\patricia.sakugawa\AppData\Local\Continuum\anaconda3\envs\cellere_img\lib\site-packages\tensorflow_core\python\keras\engine\training.py", line 908, in predict use_multiprocessing=use_multiprocessing,) File "C:\Users\patricia.sakugawa\AppData\Local\Continuum\anaconda3\envs\cellere_img\lib\site-packages\tensorflow_core\python\keras\engine\training_arrays.py", line 716, in predict x, check_steps=True, steps_name='steps', steps=steps) File "C:\Users\patricia.sakugawa\AppData\Local\Continuum\anaconda3\envs\cellere_img\lib\site-packages\tensorflow_core\python\keras\engine\training.py", line 2414, in _standardize_user_data training_utils.check_steps_argument(x, steps, steps_name) File "C:\Users\patricia.sakugawa\AppData\Local\Continuum\anaconda3\envs\cellere_img\lib\site-packages\tensorflow_core\python\keras\engine\training_utils.py", line 1199, in check_steps_argument input_type=input_type_str, steps_name=steps_name)) ValueError: When using data tensors as input to a model, you should specify thestepsargument.

klauspa commented 4 years ago

I am having the same error for inference. Do you know where the problem might be?

Traceback (most recent call last): File "detect.py", line 42, in <module> pred_bbox = model.predict(img_tensor) File "C:\Users\patricia.sakugawa\AppData\Local\Continuum\anaconda3\envs\cellere_img\lib\site-packages\tensorflow_core\python\keras\engine\training.py", line 908, in predict use_multiprocessing=use_multiprocessing,) File "C:\Users\patricia.sakugawa\AppData\Local\Continuum\anaconda3\envs\cellere_img\lib\site-packages\tensorflow_core\python\keras\engine\training_arrays.py", line 716, in predict x, check_steps=True, steps_name='steps', steps=steps) File "C:\Users\patricia.sakugawa\AppData\Local\Continuum\anaconda3\envs\cellere_img\lib\site-packages\tensorflow_core\python\keras\engine\training.py", line 2414, in _standardize_user_data training_utils.check_steps_argument(x, steps, steps_name) File "C:\Users\patricia.sakugawa\AppData\Local\Continuum\anaconda3\envs\cellere_img\lib\site-packages\tensorflow_core\python\keras\engine\training_utils.py", line 1199, in check_steps_argument input_type=input_type_str, steps_name=steps_name)) ValueError: When using data tensors as input to a model, you should specify thestepsargument.

You can try print "img_tensor" to see if it is empty, if so, maybe you didn't specify input arguments: python detect.py --image ./kite.jpg

pmikas commented 4 years ago

I am testing with the kite.jpg image

The print(img_tensor) gives: Tensor("ExpandDims:0", shape=(1, 608, 608, 3), dtype=float32)

klauspa commented 4 years ago

I am testing with the kite.jpg image

The print(img_tensor) gives: Tensor("ExpandDims:0", shape=(1, 608, 608, 3), dtype=float32)

Same error?That's strange

pmikas commented 4 years ago

Yes, same error

klauspa commented 4 years ago

If you can not figure out why, maybe use numpy array as input instead of tensor,just rewrite the code

pmikas commented 4 years ago

Ok, I will give it a try. Thanks!