当我使用export_inference_graph.py
文件夹或object_detection
文件夹中的正确路径运行models/research
时,这样:
python export_inference_graph \ # object_detection/ (if from /research)
--input_type image_tensor \
--pipeline_config_path path/to/ssd_inception_v2.config \
--trained_checkpoint_prefix path/to/model.ckpt \
--output_directory path/to/exported_model_directory
然后我得到了以下错误:
File "object_detection/export_inference_graph.py", line 71, in <module>
from object_detection import exporter
File "/usr/local/lib/python2.7/dist-packages/tensorflow/models/research/object_detection/exporter.py", line 28, in <module>
from object_detection.builders import model_builder
File "/usr/local/lib/python2.7/dist-packages/tensorflow/models/research/object_detection/builders/model_builder.py", line 17, in <module>
from object_detection.builders import anchor_generator_builder
File "/usr/local/lib/python2.7/dist-packages/tensorflow/models/research/object_detection/builders/anchor_generator_builder.py", line 20, in <module>
from object_detection.protos import anchor_generator_pb2
ImportError: cannot import name anchor_generator_pb2
在anchor_generator_builder.py
内,它会尝试导入anchor_generator_pb2
,但不存在具有此名称的文件。
其他信息: - 是的我添加了库:
# From tensorflow/models/research/
export PYTHONPATH=$PYTHONPATH:`pwd`:`pwd`/slim
- 是的,我提取了最新的tensorflow/models
版本
请告诉我如何正确导出新的Frozen Graph,我认为这应该很简单,但它会阻止我的整个工作。
提前谢谢你们
答案 0 :(得分:0)
好的,案件结案。
我忘了做Protobuf编译。
# From tensorflow/models/research/
protoc object_detection/protos/*.proto --python_out=.
对不起伙计们,我的不好