当我从文件夹或从这样的文件夹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,我认为这应该很容易,但它会停止我的整个工作。
提前谢谢你们