Skip to content

pettod/keras-model-weights-to-pytorch-model

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Transform Keras Model Weights to Pytorch Model

Introduction

Read Keras model weights from .h5 file and initialize Pytorch model with the weights. Write Pytorch model into .pt file.

Setup

The code needs to be modified to your purpose.

  1. Add your Pytorch network and import it to the file.
  2. Read Keras model properly: define model file name and add needed custom objects to 'load_model' function.

About

Read Keras model weights and write them to Pytorch model

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages