我使用以下命令创建了一个 .pb 文件:
flow --model ../YOLOv2/alexeyAB_darknet/darknet-master/cfg/yolov2-dppedestrian.cfg --load ../YOLOv2/alexeyAB_darknet/darknet-master/backup/yolov2-dppedestrian_33900.weights --savepb
虽然模型创建成功,但当我将它加载到我的 java tensorflow 应用程序中时,我收到以下错误:
Exception in thread "Thread-9" org.tensorflow.TensorFlowException: Could not find meta graph def matching supplied tags: { serve }. To inspect available tag-sets in the SavedModel, please use the SavedModel CLI: saved_model_cli
问题出在第二行代码中:
String model_path = "/home/adisys/Desktop/cloudiV2/models/yolo_pedestrian/saved_model";
SavedModelBundle model = SavedModelBundle.load(model_path, "serve");
我尝试深入挖掘并找到此链接: Can not load pb file in tensorflow serving 在链接之后我运行了以下命令:
saved_model_cli show --dir saved_model/
输出如下:
/home/adisys/anaconda3/lib/python3.6/site-packages/h5py/init.py:34:FutureWarning:不推荐将 issubdtype 的第二个参数从 float 转换为 np.floating。将来,它将被视为 np.float64 == np.dtype(float).type。from ._conv import register_converters as _register_converters
给定的 SavedModel 包含以下标签集:
可以看出,没有显示标签集。可能是什么问题?