TypeError: non_max_suppression() got an unexpected keyword argument 'score_threshold'
System information
- What is the top-level directory of the model you are using: /models/research/
- Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 16.04
- TensorFlow installed from (source or binary): Binary
- TensorFlow version (use command below): 1.10.0,1.8.0
- Bazel version (if compiling from source): NA
- CUDA/cuDNN version:9.0,7.0
- GPU model and memory:Nvidia Quadro P3000
- Exact command to reproduce: 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
I hit the same issue using tf 1.8. Tensorflow versions < 1.9 did not support the score_threshold param. You'll have to be sure you're using version 1.9 or newer. Unfortunately I've also encountered issues with estimator based training on v1.10, In my case, v1.9 is the only working version for object detection.
I have this issue on:
^CFernandos-MacBook-Pro:research fernandomartin$ python -c "import tensorflow as tf; print(tf.GIT_VERSION, tf.VERSION)"
('v1.10.0-rc1-0-ge5e9a8f4e9', '1.10.0-rc1')
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.
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 [email protected] 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 https://github.com/tensorflow/models/issues/5056#issuecomment-417012261, 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 [email protected] 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 https://github.com/tensorflow/models/issues/5056#issuecomment-419655300, 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.
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!
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 i could't find any solution please help me
@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. if someone has solution then tell me please
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!
I have updated tensorflow using this command
pip install --ignore-installed --upgrade tensorflow==1.9.0
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 This is how I was able to run the object detection in my environment.