Yolov4-tensorflow icon indicating copy to clipboard operation
Yolov4-tensorflow copied to clipboard

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

Open qiumei1101 opened this issue 4 years ago • 8 comments

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

qiumei1101 avatar May 30 '20 17:05 qiumei1101

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

klauspa avatar May 31 '20 02:05 klauspa

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 the steps argument.

pmikas avatar Jun 23 '20 14:06 pmikas

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 the steps argument.

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

klauspa avatar Jun 23 '20 14:06 klauspa

I am testing with the kite.jpg image

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

pmikas avatar Jun 23 '20 15:06 pmikas

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

klauspa avatar Jun 23 '20 16:06 klauspa

Yes, same error

pmikas avatar Jun 23 '20 16:06 pmikas

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

klauspa avatar Jun 23 '20 16:06 klauspa

Ok, I will give it a try. Thanks!

pmikas avatar Jun 23 '20 16:06 pmikas