-
Notifications
You must be signed in to change notification settings - Fork 45.6k
TypeError: non_max_suppression() got an unexpected keyword argument 'score_threshold' #5056
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
Comments
I hit the same issue using tf 1.8. Tensorflow versions < 1.9 did not support the |
I have this issue on:
|
Hi, I have the same issue. I'm using tensorflow 1.5 and python 2.7. What is the workaround for that? |
Please use tf 1.9+ as mentioned here. I'm surprised that tf 1.10 doesn't work with this. I'll look into it. Thanks! |
@pkulzc The object detection tutorial should be updated to use 1.9 as a runtime (as opposed to 1.8 that it currently uses, giving this error). I imagine object_detection/samples/cloud/cloud.yml should also be updated. |
The bash script to submit training job for pets detection has runtime-version of 1.8. This will trigger `TypeError: non_max_suppression() got an unexpected keyword argument 'score_threshold'` on the Google Cloud since 1.8 and older does not support this keyword argument. Therefore, update this runtime version to 1.9, which is the most recent runtime version that is published on June 27, 2018. See tensorflow#5056 https://cloud.google.com/ml-engine/docs/tensorflow/runtime-version-list
The bash script to submit training job for pets detection has runtime-version of 1.8. This will trigger `TypeError: non_max_suppression() got an unexpected keyword argument 'score_threshold'` on the Google Cloud since 1.8 and older does not support this keyword argument. Therefore, update this runtime version to 1.9, which is the most recent runtime version that is published on June 27, 2018. See tensorflow#5056 https://cloud.google.com/ml-engine/docs/tensorflow/runtime-version-list
I upgraded to 1.9 now I have Illegal instruction (core dumped), when I try to train. |
What's the error message @Swaarup ? |
The error I get is
*Illegal instruction (core dumped).*
*I tried with all the available versions of TensorFlow. It runs only with
1.5.0 and I get the error non_max_suppression() got an unexpected keyword
argument 'score_threshold'. For other versions I get the error Illegal
instruction. *
…On Wed, Aug 29, 2018, 18:22 pkulzc ***@***.***> wrote:
What's the error message @Swaarup <https://github.com/Swaarup> ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5056 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AhYm3zEz3AccjBvz4s7RCZDhq8WY32sQks5uVr-qgaJpZM4V4Zbe>
.
|
@Swaarup when you upgraded to 1.9 did you also compile protos again? |
No, I couldn't figure out the solution myself. So i tried it in another PC
and was able to train it without any problem when upgraded to 1.9
…On Sat, Sep 8, 2018, 22:10 mawanda-jun ***@***.***> wrote:
@Swaarup <https://github.com/Swaarup> when you upgraded to 1.9 did you
also compile protos again?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5056 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AhYm387JFF9waX7s1WRFQxYu8k911d5fks5uY--WgaJpZM4V4Zbe>
.
|
Tried TF 1.11 today, got the same error message. It works after downgrade to TF 1.9. |
Hi @pkulzc , I have trained an object detector model in mobilenet ssd using tensorflow 1.7.1. I am suffering from the same problem as mentioned in this thread and the reason I cannot upgrade to tensorflow 1.9 is that ultimately I'll be needing to use my weights in unity and it only supports tensorflow 1.7.1. Is there any workaround with this issue? |
@Amanpradhan Your case is a bit tricky. I think you can replace this block with an older version that use nms op without score_th and do it separately. |
i have faced same issue with tf.v1.5 and tf.v1.9 but not solve my issue please guide me in that issue |
TypeError: non_max_suppression() got an unexpected keyword argument 'score_threshold' i got this error with tf.v.1.5 and with tf.v.1.9 illegal instructions |
@MWaseemMatto sometimes its just because of the computational limitations. I had exact same error I tried all the different version and approaches but didn't succeeded, later I tried the same task in another PC and it worked. I know it's not the proper solution but just a way around? |
I converted the model using tensorflow 1.7 since the non_max_suppression() was introduced in 1.9 and above. |
@Amanpradhan thanks your comment but i still stuck in that case. |
I have updated tensorflow using this command But on printing tf.version it is showing 1.8.0 So is there any way to update tensorflow to specific version? |
I was having a tough time finding the correct tensorflow version as well. Do one thing, install tensorflow 1.7 in another environment and clone the object detection part from here:https://github.com/stevenobadja/math_object_detection |
Can you please tell me specifically where needs to be replaced? I replaced the blocked lines but it seems not making sense and it is not working. |
Object detection API now requires tf 1.12 so it's definitely recommended to move to 1.12 if possible. To those who have to use 1.X version TF (X<12) : |
Latest version of the tf 1.13 worked for me.
…On Wed, 5 Jun 2019, 12:59 PM pkulzc, ***@***.***> wrote:
Object detection API now requires tf 1.12 so it's definitely recommended
to move to 1.12 if possible.
To those who have to use 1.X version TF (X<12) :
An easier workaround would be reset your models/ repo to an earlier commit
that only requires tf 1.X, and run
object_detection/export_inference_graph.py to reexport the models
provided/trained.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5056?email_source=notifications&email_token=AKQKM3IUXDZQCVIP5RVG5NLPY5W63A5CNFSM4FPBS3PKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODW65DLI#issuecomment-498979245>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AKQKM3J3EA36TSTSD3AANLTPY5W63ANCNFSM4FPBS3PA>
.
|
Below method solved perfectly(tf1.8): |
I found my nms is lost when implement 'pb'? |
Could you load the file to unity later ? |
我用的是1.5.0的版本,也遇到了这个问题,请问怎么办? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you. |
Closing as stale. Please reopen if you'd like to work on this further. |
System information
/models/research/
No
Linux Ubuntu 16.04
Binary
1.10.0,1.8.0
python object_detection/model_main.py --pipeline_config_path=${PIPELINE_CONFIG_PATH} --model_dir=${MODEL_DIR} --num_train_steps=${NUM_TRAIN_STEPS} --num_eval_steps=${NUM_EVAL_STEPS} --alsologtostderr
Describe the problem
Describe the problem clearly here. Be sure to convey here why it's a bug in TensorFlow or a feature request.
TypeError: non_max_suppression() got an unexpected keyword argument 'score_threshold' when running TF object detection API. Looks like the recent commit by @pkulzc 59f7e80 has some bug.
Source code / logs
Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached. Try to provide a reproducible test case that is the bare minimum necessary to generate the problem.
Traceback (most recent call last):
File "object_detection/model_main.py", line 101, in
tf.app.run()
File "/home/anikethseelam/anaconda2/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 126, in run
_sys.exit(main(argv))
File "object_detection/model_main.py", line 97, in main
tf.estimator.train_and_evaluate(estimator, train_spec, eval_specs[0])
File "/home/anikethseelam/anaconda2/lib/python2.7/site-packages/tensorflow/python/estimator/training.py", line 439, in train_and_evaluate
executor.run()
File "/home/anikethseelam/anaconda2/lib/python2.7/site-packages/tensorflow/python/estimator/training.py", line 518, in run
self.run_local()
File "/home/anikethseelam/anaconda2/lib/python2.7/site-packages/tensorflow/python/estimator/training.py", line 650, in run_local
hooks=train_hooks)
File "/home/anikethseelam/anaconda2/lib/python2.7/site-packages/tensorflow/python/estimator/estimator.py", line 363, in train
loss = self._train_model(input_fn, hooks, saving_listeners)
File "/home/anikethseelam/anaconda2/lib/python2.7/site-packages/tensorflow/python/estimator/estimator.py", line 843, in _train_model
return self._train_model_default(input_fn, hooks, saving_listeners)
File "/home/anikethseelam/anaconda2/lib/python2.7/site-packages/tensorflow/python/estimator/estimator.py", line 856, in _train_model_default
features, labels, model_fn_lib.ModeKeys.TRAIN, self.config)
File "/home/anikethseelam/anaconda2/lib/python2.7/site-packages/tensorflow/python/estimator/estimator.py", line 831, in _call_model_fn
model_fn_results = self._model_fn(features=features, **kwargs)
File "/home/anikethseelam/HAVAL/Summer2018/repos/models/research/object_detection/model_lib.py", line 252, in model_fn
preprocessed_images, features[fields.InputDataFields.true_image_shape])
File "/home/anikethseelam/HAVAL/Summer2018/repos/models/research/object_detection/meta_architectures/faster_rcnn_meta_arch.py", line 680, in predict
self._anchors.get(), image_shape, true_image_shapes))
File "/home/anikethseelam/HAVAL/Summer2018/repos/models/research/object_detection/meta_architectures/faster_rcnn_meta_arch.py", line 767, in _predict_second_stage
anchors, image_shape_2d, true_image_shapes)
File "/home/anikethseelam/HAVAL/Summer2018/repos/models/research/object_detection/meta_architectures/faster_rcnn_meta_arch.py", line 1234, in _postprocess_rpn
clip_window=clip_window)
File "/home/anikethseelam/HAVAL/Summer2018/repos/models/research/object_detection/core/post_processing.py", line 402, in batch_multiclass_non_max_suppression
parallel_iterations=parallel_iterations)
File "/home/anikethseelam/HAVAL/Summer2018/repos/models/research/object_detection/utils/shape_utils.py", line 228, in static_or_dynamic_map_fn
return tf.map_fn(fn, elems, dtype, parallel_iterations, back_prop)
File "/home/anikethseelam/anaconda2/lib/python2.7/site-packages/tensorflow/python/ops/functional_ops.py", line 423, in map_fn
swap_memory=swap_memory)
File "/home/anikethseelam/anaconda2/lib/python2.7/site-packages/tensorflow/python/ops/control_flow_ops.py", line 3224, in while_loop
result = loop_context.BuildLoop(cond, body, loop_vars, shape_invariants)
File "/home/anikethseelam/anaconda2/lib/python2.7/site-packages/tensorflow/python/ops/control_flow_ops.py", line 2956, in BuildLoop
pred, body, original_loop_vars, loop_vars, shape_invariants)
File "/home/anikethseelam/anaconda2/lib/python2.7/site-packages/tensorflow/python/ops/control_flow_ops.py", line 2893, in _BuildLoop
body_result = body(*packed_vars_for_body)
File "/home/anikethseelam/anaconda2/lib/python2.7/site-packages/tensorflow/python/ops/functional_ops.py", line 413, in compute
packed_fn_values = fn(packed_values)
File "/home/anikethseelam/HAVAL/Summer2018/repos/models/research/object_detection/core/post_processing.py", line 378, in _single_image_nms_fn
additional_fields=per_image_additional_fields)
File "/home/anikethseelam/HAVAL/Summer2018/repos/models/research/object_detection/core/post_processing.py", line 150, in multiclass_non_max_suppression
score_threshold=score_thresh)
TypeError: non_max_suppression() got an unexpected keyword argument 'score_threshold'
The text was updated successfully, but these errors were encountered: