Running SSD in latest Tensorflow
I tried to run SSD using the latest Tensorflow >= r1.12 and had a lot of issues. Wonder will support of latest Tensorflow be added in the future?
I tried to run inference with the following command:
python eval_ssd_network.py
--eval_dir=${EVAL_DIR}
--dataset_dir=${DATASET_DIR}
--dataset_name=pascalvoc_2007
--dataset_split_name=test
--model_name=ssd_300_vgg
--checkpoint_path=${CHECKPOINT_PATH}
--batch_size=8
but got the following error
Traceback (most recent call last):
File "eval_ssd_network.py", line 360, in
Then I changed line 51 in /data/SSD/tf_extended/metrics.py to return variables.VariableV1( , the above error went away, but the script exits without actually running inference. Any hint on this problem? Thanks!
@rabbitwayne Hello! I have met the same problem. Have you solved it? Thanks a lot!
sorry, my mistake to not show you all information:
- used 1.13rc1,
- change tf_extended/metrics.py line 51 to variables.VariableV1
- add a function
def flatten(x): result = [] for el in x: if isinstance(el, tuple): result.extend(flatten(el)) else: result.append(el) return result
and flatten the parameter of slim.evaluation.evaluate_once as "eval_op=flatten(list(names_to_updates.values())),"
@bygreencn That helps! Thanks a lot!!
1、I changed the tf_extended/metrics.py line 51 to variables.VariableV1 2、you mean where to add a function? in eval_ssd_network.py??? @bygreencn @xiyuanzh
can you tell me your tf version?? @bygreencn @xiyuanzh
@Sulince Yes, in eval_ssd_network.py. My version is r1.12. Now I can run the evaluation code but get a mAP of 0. #221 states the same problem with me. It seems to have something to do with the flatten fuction and I haven't found out the solution. If you can sucessfully get the result, could you please help me with it? @bygreencn @rabbitwayne Have you met the same problem of 0 mAP before? This is the output of the flatten fuction:
[<tf.Tensor 'mean/update_op:0' shape=() dtype=float32>, <tf.Tensor 'mean_1/update_op:0' shape=() dtype=float32>, <tf.Tensor 'mean_2/update_op:0' shape=() dtype=float32>, <tf.Tensor 'streaming_tp_fp_1/AssignAdd:0' shape=() dtype=int64_ref>, <tf.Tensor 'streaming_tp_fp_1/AssignAdd_1:0' shape=() dtype=int32_ref>, <tf.Tensor 'streaming_tp_fp_1/Assign_1:0' shape=(?,) dtype=bool_ref>, <tf.Tensor 'streaming_tp_fp_1/Assign_2:0' shape=(?,) dtype=bool_ref>, <tf.Tensor 'streaming_tp_fp_1/Assign:0' shape=(?,) dtype=float32_ref>]
I need your help!! Thanks a lot!!
I have run eval_ssd_network.py succefully, but i got the same problem that the mAP is very low ,just like the result you had got . I got no idea to solve it. Have you solve it yet??? @xiyuanzh if you solve it, help me! please! contact me at [email protected]
@Sulince Hello, have you solved the problem? I tried to contact you but the email address does not exist.
@xiyuanzh sorry, i give the wrong address, i have correct it . and i have solved the problem. see at @ #264
sorry, my mistake to not show you all information:
- used 1.13rc1,
- change tf_extended/metrics.py line 51 to variables.VariableV1
- add a function
def flatten(x): result = [] for el in x: if isinstance(el, tuple): result.extend(flatten(el)) else: result.append(el) return result
and flatten the parameter of slim.evaluation.evaluate_once as "eval_op=flatten(list(names_to_updates.values())),"
sorry, but I cannot find "eval_op=flatten(list(names_to_updates.values()))," . could you tell me what py file can find it in?
I have run eval_ssd_network.py succefully, but i got the same problem that the mAP is very low ,just like the result you had got . I got no idea to solve it. Have you solve it yet??? @xiyuanzh if you solve it, help me! please! contact me at [email protected]
Can you tell me the version of python and tensorflow? I need a right and proper environment,thanks.
Hi @Sulince @xiyuanzh , did you guys managed to solve the issue of getting 0 mAP? If yes, could you enlighten on how did you guys solve it?
INFO:tensorflow:Evaluation [963/9634] I0803 12:24:58.229241 9844 evaluation.py:167] Evaluation [963/9634] INFO:tensorflow:Evaluation [1926/9634] I0803 12:27:41.523166 9844 evaluation.py:167] Evaluation [1926/9634] INFO:tensorflow:Evaluation [2889/9634] I0803 12:30:22.842613 9844 evaluation.py:167] Evaluation [2889/9634] INFO:tensorflow:Evaluation [3852/9634] I0803 12:33:05.738677 9844 evaluation.py:167] Evaluation [3852/9634] INFO:tensorflow:Evaluation [4815/9634] I0803 12:35:47.935612 9844 evaluation.py:167] Evaluation [4815/9634] INFO:tensorflow:Evaluation [5778/9634] I0803 12:38:28.797521 9844 evaluation.py:167] Evaluation [5778/9634] INFO:tensorflow:Evaluation [6741/9634] I0803 12:41:10.568399 9844 evaluation.py:167] Evaluation [6741/9634] INFO:tensorflow:Evaluation [7704/9634] I0803 12:43:52.274564 9844 evaluation.py:167] Evaluation [7704/9634] INFO:tensorflow:Evaluation [8667/9634] I0803 12:46:36.202533 9844 evaluation.py:167] Evaluation [8667/9634] INFO:tensorflow:Evaluation [9630/9634] I0803 12:49:18.376631 9844 evaluation.py:167] Evaluation [9630/9634] INFO:tensorflow:Evaluation [9634/9634] I0803 12:49:19.001646 9844 evaluation.py:167] Evaluation [9634/9634] AP_VOC07/mAP[0] AP_VOC12/mAP[0] INFO:tensorflow:Finished evaluation at 2020-08-03-12:49:26 I0803 12:49:26.129172 9844 evaluation.py:275] Finished evaluation at 2020-08-03-12:49:26 Time spent : 1694.618 seconds. Time spent per BATCH: 0.176 seconds.