leohsuofnthu / Tensorflow-YOLACT

Implementation of the paper "YOLACT Real-time Instance Segmentation" in Tensorflow 2
111 stars 36 forks source link

How to save the whole model with .h5 format? #13

Open Liusandian opened 4 years ago

Liusandian commented 4 years ago

Hi, when I want to save the whole model into h5 format,I encountered this problem and I don’t know how to solve it, if this solution is not working, do you any better solution to save the whole model?I am looking forward to your reply ,thanks!

In train.py line 214,I add the code in order to save the whole model ,here I use the model.save()function instead of model.save_weights() function,but I got this error:

ValueError: Model <yolact.Yolact object at 0x7f8ec826d150> cannot be saved because the input shapes have not been set. Usually, input shapes are automatically determined from calling .fit() or .predict(). To manually set the shapes, call model._set_inputs(inputs).