bubbliiiing / yolov4-tiny-pytorch

这是一个YoloV4-tiny-pytorch的源码,可以用于训练自己的模型。
MIT License
787 stars 184 forks source link

Convert h5 to PD file #93

Closed terryll closed 2 years ago

terryll commented 2 years ago

After training, .h5 is generated. When try to convert the .h5 to PD file, the following error occur. File "C:\ProgramData\Anaconda3b\envs\gpu59\lib\site-packages\tensorflow\python\keras\saving\hdf5_format.py", line 176, in load_model_from_hdf5 raise ValueError('No model found in config file.') ValueError: No model found in config file.

The code to convert from .h5 to .pd are: import tensorflow as tf

pre_model = tf.keras.models.load_model('best_epoch_weights.H5') tf.saved_model.save(pre_model,"yoloV4_tiny_tf2")

Thanks in advance for any helps.

bubbliiiing commented 2 years ago

This is pytorch code. How can H5 files be generated

terryll commented 2 years ago

Thanks for pointing that out. I did missed that.