When following through the instructions in models/research/object_detection/g3doc/running_pets.md the python script generates a FutureWarning from lxml:
/Users/williamayd/clones/models/research/object_detection/utils/dataset_util.py:75: FutureWarning: The behavior of this method will change in future versions. Use specific 'len(elem)' or 'elem is not None' test instead.
if not xml:
The offending line is below and the FutureWarning should be easily resolved if replace with the more explicit len(xml):
The xml parsing code issues a warning from lxml for the boolean check it performs to detect whether or not there are child elements. If lxml changes this behavior in the future this code will break.
Source code / logs
Provided again for reference. Here is the offending line:
/Users/williamayd/clones/models/research/object_detection/utils/dataset_util.py:75: FutureWarning: The behavior of this method will change in future versions. Use specific 'len(elem)' or 'elem is not None' test instead.
if not xml:
When following through the instructions in models/research/object_detection/g3doc/running_pets.md the python script generates a FutureWarning from lxml:
The offending line is below and the FutureWarning should be easily resolved if replace with the more explicit
len(xml)
:https://github.com/tensorflow/models/blob/29c9f9855711006704b8fa9364f966d67694287e/research/object_detection/utils/dataset_util.py#L75
I would be happy to submit a PR to clean this up
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): Stock example
OS Platform and Distribution (e.g., Linux Ubuntu 16.04): macOS High Sierra 10.13.5
TensorFlow installed from (source or binary): Source
TensorFlow version (use command below): v1.8.0-0-g93bc2e2072 1.8.0
Bazel version (if compiling from source): bazel release 0.14.1-homebrew
CUDA/cuDNN version:
GPU model and memory:
Exact command to reproduce: Taken directly from models/research/object_detection/g3doc/running_pets.md:
Describe the problem
The xml parsing code issues a warning from lxml for the boolean check it performs to detect whether or not there are child elements. If lxml changes this behavior in the future this code will break.
Source code / logs
Provided again for reference. Here is the offending line:
https://github.com/tensorflow/models/blob/29c9f9855711006704b8fa9364f966d67694287e/research/object_detection/utils/dataset_util.py#L75
And the warning that it generates: