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

eval_metric_ops[confusion_matrix] must be Operation or Tensor #82

Open
jeicy07 opened this issue Feb 19, 2020 · 3 comments
Open

eval_metric_ops[confusion_matrix] must be Operation or Tensor #82

jeicy07 opened this issue Feb 19, 2020 · 3 comments

Comments

@jeicy07
Copy link

jeicy07 commented Feb 19, 2020

When the code is doing the evaluation, there is an error when returning the evaluation result : result = estimator.evaluate(input_fn=eval_input_fn). Detailed error is probably related to the confusion matrix.
It says that: TypeError: eval_metric_ops[confusion_matrix] must be Operation or Tensor, given: <tf.Variable 'total_confusion_matrix:0' shape=(12, 12) dtype=float64_ref>
my tensorflow's version is 1.11.0

@chuanzhizh
Copy link

When the code is doing the evaluation, there is an error when returning the evaluation result : result = estimator.evaluate(input_fn=eval_input_fn). Detailed error is probably related to the confusion matrix.
It says that: TypeError: eval_metric_ops[confusion_matrix] must be Operation or Tensor, given: <tf.Variable 'total_confusion_matrix:0' shape=(12, 12) dtype=float64_ref>
my tensorflow's version is 1.11.0

hi, is the problem solved?

@chuanzhizh
Copy link

the earlier version of my tensorflow is 1.10.0 python3.5, when I update my tensorflow to 1.15.0 and python to 3.6, the problem solved

@jeicy07
Copy link
Author

jeicy07 commented Mar 4, 2020

the earlier version of my tensorflow is 1.10.0 python3.5, when I update my tensorflow to 1.15.0 and python to 3.6, the problem solved

hi, I didn't update my tensorflow. I just revised return (total_cm, update_op) at the end of function streaming_confusion_matrix in metrics.py to return (total_cm.read_value(), update_op).

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

2 participants