thtrieu / darkflow

Translate darknet to tensorflow. Load trained weights, retrain/fine-tune using tensorflow, export constant graph def to mobile devices
GNU General Public License v3.0
6.13k stars 2.09k forks source link

saved .pb file not loading in java #865

Open sjaiswal25 opened 5 years ago

sjaiswal25 commented 5 years ago

I used the following command to create a .pb file: flow --model ../YOLOv2/alexeyAB_darknet/darknet-master/cfg/yolov2-dppedestrian.cfg --load ../YOLOv2/alexeyAB_darknet/darknet-master/backup/yolov2-dppedestrian_33900.weights --savepb

Although the model was created successfully, when I load it into my java tensorflow application, I get the following error: 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

The problem is in the second line of code: String model_path = "/home/adisys/Desktop/cloudiV2/models/yolo_pedestrian/saved_model"; SavedModelBundle model = SavedModelBundle.load(model_path, "serve");

I tried digging deep and found this link: https://github.com/tensorflow/serving/issues/491 Following the link I ran the following command: saved_model_cli show --dir saved_model/

The output is as follows: /home/adisys/anaconda3/lib/python3.6/site-packages/h5py/init.py:34: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type. from ._conv import register_converters as _register_converters The given SavedModel contains the following tag-sets:

As can be seen, there were no tag-sets displayed. help would be appreciated.

thekevshow commented 5 years ago

Having the same issue. Did you come up with a solution at all?

Sequential-circuits commented 4 years ago

Same with me