DeepLabV3-Plus icon indicating copy to clipboard operation
DeepLabV3-Plus copied to clipboard

How to re-train or continue training ?!?!

Open thusinh1969 opened this issue 3 years ago • 0 comments

Hi,

Great stuffs really. I walked through your code a lot, but still not sure how to reload weights to continue training should I terminate in the middle for some reasons.

I edited train.py: ... if "reload_weight_checkpoint" in self.config.keys() and self.config["reload_weight_checkpoint"]!="": self.model.load_weights(self.config["reload_weight_checkpoint"]) ... right before fit.

--> ERROR:

ValueError Traceback (most recent call last) in ----> 1 history = trainer.train()

D:\AI\Human_Pose\DeepLabV3-Plus\deeplabv3plus\train.py in train(self) 188 189 if "reload_weight_checkpoint" in self.config.keys() and self.config["reload_weight_checkpoint"]!="": --> 190 self.model.load_weights(self.config["reload_weight_checkpoint"]) 191 192 history = self.model.fit(

~\AppData\Roaming\Python\Python38\site-packages\tensorflow\python\keras\engine\training.py in load_weights(self, filepath, by_name, skip_mismatch, options) 2220 'load_weights requires h5py when loading weights from HDF5.') 2221 if not self._is_graph_network and not self.built: -> 2222 raise ValueError( 2223 'Unable to load weights saved in HDF5 format into a subclassed ' 2224 'Model which has not created its variables yet. Call the Model '

ValueError: Unable to load weights saved in HDF5 format into a subclassed Model which has not created its variables yet. Call the Model first, then load the weights.

Thanks much. Steve

thusinh1969 avatar May 04 '21 19:05 thusinh1969