按照文档模型导出会有问题
Created by: NHZlX
按照模型导出文档(https://github.com/PaddlePaddle/PaddleDetection/blob/release/0.1/docs/EXPORT_MODEL.md), 运行如下代码:
# 导出FasterRCNN模型, 模型中data层默认的shape为3x800x1333
python tools/export_model.py -c configs/faster_rcnn_r50_1x.yml \
--output_dir=./inference_model \
-o weights=output/faster_rcnn_r50_1x/model_final \
会出现以下的错误:
Traceback (most recent call last):
File "tools/export_model.py", line 23, in <module>
from ppdet.core.workspace import load_config, merge_config, create
ImportError: No module named ppdet.core.workspace
需要在tools/export_model.py 中加入:
import sys
abs_path = os.path.abspath(os.path.dirname(__file__))
sys.path.insert(0, os.path.join(abs_path, ".." ))