Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
thusinh1969 opened this issue May 4, 2021 · 0 comments
Open

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

thusinh1969 opened this issue May 4, 2021 · 0 comments

Comments

@thusinh1969
Copy link

thusinh1969 commented May 4, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant