TensorFlow2.0-Examples icon indicating copy to clipboard operation
TensorFlow2.0-Examples copied to clipboard

YoloV3 saving weights

Open FishJyz opened this issue 4 years ago • 4 comments

You can use tf.layers.Lambda to include all of your non-layer functions in the YOLO network(like tile,cast,etc.), thus they are technically a layer but not functions in the network, and you can write and load weights.h5 files. However, I still don't know how to save the whole network.

FishJyz avatar Mar 10 '20 10:03 FishJyz

Me too,good question!When I run train.py to train yolo network,once epoch finished,it raise error like:

Traceback (most recent call last): File "train.py", line 95, in model.save_weights(str(epoch) + "_yolov3_weight.h5") File ".../anaconda3/envs/tf-2.1/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/network.py", line 1107, in save_weights hdf5_format.save_weights_to_hdf5_group(f, self.layers) File ".../anaconda3/envs/tf-2.1/lib/python3.7/site-packages/tensorflow_core/python/keras/saving/hdf5_format.py", line 625, in save_weights_to_hdf5_group g = f.create_group(layer.name) File ".../envs/tf-2.1/lib/python3.7/site-packages/h5py/_hl/group.py", line 68, in create_group gid = h5g.create(self.id, name, lcpl=lcpl, gcpl=gcpl) File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper File "h5py/h5g.pyx", line 161, in h5py.h5g.create ValueError: Unable to create group (name already exists)

Flowingsun007 avatar Mar 12 '20 13:03 Flowingsun007

Mee too i do not know how to save .h5 who can tell me

pp1bb avatar Jun 04 '20 06:06 pp1bb

Mee too i do not know how to save .h5 who can tell me

can you save as xxx.weights file?,i got many files like this xx.data-00001-of-00002 xx.index xx.chechpoint

MC1016 avatar Sep 04 '20 02:09 MC1016

Mee too i do not know how to save .h5 who can tell me

you can use model.save(xxxxx.5h)

MC1016 avatar Sep 05 '20 01:09 MC1016