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

cannot reshape array of size 501 into shape (85) #92

Open
yifeili2019 opened this issue Jan 20, 2020 · 5 comments
Open

cannot reshape array of size 501 into shape (85) #92

yifeili2019 opened this issue Jan 20, 2020 · 5 comments

Comments

@yifeili2019
Copy link

Hi,when I tried your code, I met this mistake. Can someone help me
Traceback (most recent call last):
File "demo.py", line 105, in
tf.app.run()
File "/home/dell/.local/lib/python3.5/site-packages/tensorflow/python/platform/app.py", line 40, in run
_run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef)
File "/home/dell/.local/lib/python3.5/site-packages/absl/app.py", line 300, in run
_run_main(main, args)
File "/home/dell/.local/lib/python3.5/site-packages/absl/app.py", line 251, in _run_main
sys.exit(main(argv))
File "demo.py", line 96, in main
iou_threshold=FLAGS.iou_threshold)
File "/home/dell/Desktop/Yolov3/tensorflow-yolo-v3-master/utils.py", line 191, in non_max_suppression
image_pred = image_pred.reshape(-1, shape[-1])
ValueError: cannot reshape array of size 501 into shape (85)

@Howave
Copy link

Howave commented Apr 17, 2020

line 189:
non_zero_idxs = np.nonzero(image_pred[:, 4])

@fnando1995
Copy link

got similar:

defined>, <undefined>
2020-04-26 20:07:38.743339: W tensorflow/compiler/jit/mark_for_compilation_pass.cc:1412] (One-time warning): Not using XLA:CPU for cluster because envvar TF_XLA_FLAGS=--tf_xla_cpu_global_jit was not set.  If you want XLA:CPU, either set that envvar, or use experimental_jit_scope to enable XLA:CPU.  To confirm that XLA is active, pass --vmodule=xla_compilation_cache=1 (as a proper command-line flag, not via TF_XLA_FLAGS) or set the envvar XLA_FLAGS=--xla_hlo_profile.
Traceback (most recent call last):
  File "./demo.py", line 105, in <module>
    tf.app.run()
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/platform/app.py", line 40, in run
    _run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef)
  File "/usr/local/lib/python3.6/dist-packages/absl/app.py", line 299, in run
    _run_main(main, args)
  File "/usr/local/lib/python3.6/dist-packages/absl/app.py", line 250, in _run_main
    sys.exit(main(argv))
  File "./demo.py", line 96, in main
    iou_threshold=FLAGS.iou_threshold)
  File "/home/efmb/Documents/udacity/nd131/Converting_yolov3/tensorflow-yolo-v3/utils.py", line 191, in non_max_suppression
    image_pred = image_pred.reshape(-1, shape[-1])
ValueError: cannot reshape array of size 920 into shape (85)

any help?

@cocoyen1995
Copy link

I met the same issue when trying to run demo.py, here's the solution works for me others discussed before, hope it helps!

@fnando1995
Copy link

@cocoyen1995 yeah, it work out!

@LucasMahieu
Copy link
Contributor

related to #105

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

5 participants