擅长:python、mysql、java
<p>在这种特殊情况下,可以通过使用<code>object_detection.utils/config_utils</code>文件并直接从模型配置文件加载要复制的映像配置来避免无法手动创建模板的问题:</p>
<pre><code>from object_detection.protos import image_resizer_pb2
from object_detection.utils import config_util as c
config = c.get_configs_from_pipeline_file(r"C:\Users\Person\.keras\datasets\efficientdet_d7_coco17_tpu-32\pipeline.config")
image_config = c.get_image_resizer_config(config['model'])
print(image_config.ListFields())
</code></pre>
<pre><code>[(<google.protobuf.descriptor.FieldDescriptor object at 0x000002446C225F40>, min_dimension: 1536
max_dimension: 1536
pad_to_max_dimension: true
)]
</code></pre>
<p>这样就避免了只读属性的问题,尽管我仍然不知道它是如何被解释为只读的,或者如何正常地解决这个问题</p>