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

detect.py ERROR #34

Closed
CnybTseng opened this issue Jul 6, 2019 · 1 comment
Closed

detect.py ERROR #34

CnybTseng opened this issue Jul 6, 2019 · 1 comment

Comments

@CnybTseng
Copy link

python detect.py --weights ./checkpoints/yolov3-tiny.tf --tiny --image ./data/girl.png

W0706 03:01:45.838256 139645809293184 deprecation.py:506] From /usr/local/lib/python3.6/dist-packages/tensorflow/python/ops/init_ops.py:1251: calling VarianceScaling.init (from tensorflow.python.ops.init_ops) with dtype is deprecated and will be removed in a future version.
Instructions for updating:
Call initializer instance with the dtype argument instead of passing it to the constructor
2019-07-06 03:01:47.077830: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2300000000 Hz
2019-07-06 03:01:47.078112: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x16d4a00 executing computations on platform Host. Devices:
2019-07-06 03:01:47.078146: I tensorflow/compiler/xla/service/service.cc:175] StreamExecutor device (0): ,
2019-07-06 03:01:47.158210: 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.
I0706 03:01:47.481413 139645809293184 detect.py:29] weights loaded
I0706 03:01:47.481828 139645809293184 detect.py:32] classes loaded
I0706 03:01:47.794163 139645809293184 detect.py:41] time: 0.30501627922058105
I0706 03:01:47.794389 139645809293184 detect.py:43] detections:
Traceback (most recent call last):
File "detect.py", line 56, in
app.run(main)
File "/usr/local/lib/python3.6/dist-packages/absl/app.py", line 300, in run
_run_main(main, args)
File "/usr/local/lib/python3.6/dist-packages/absl/app.py", line 251, in _run_main
sys.exit(main(argv))
File "detect.py", line 44, in main
for i in range(nums[0]):
TypeError: 'Tensor' object cannot be interpreted as an integer

@Pari-singh
Copy link

I had this issue as well but then I realized it was because somewhere in the code I had used tf.compat.v1 to get the function from the version 1. Have a look if you are purely using TF v2.

@zzh8829 zzh8829 closed this as completed Dec 21, 2019
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

3 participants