https://github.com/kaczmarj/hovernet-convert-tf-ckpt-to-npz
Convert HoVerNet TensorFlow checkpoints to NumPy npz format.
https://github.com/kaczmarj/hovernet-convert-tf-ckpt-to-npz
Last synced: about 2 months ago
JSON representation
Convert HoVerNet TensorFlow checkpoints to NumPy npz format.
- Host: GitHub
- URL: https://github.com/kaczmarj/hovernet-convert-tf-ckpt-to-npz
- Owner: kaczmarj
- License: mit
- Created: 2021-05-31T16:38:39.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-05-31T16:39:00.000Z (about 4 years ago)
- Last Synced: 2025-02-10T03:17:06.106Z (4 months ago)
- Language: Python
- Size: 2.93 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Convert HoVerNet TensorFlow checkpoints to NumPy NPZ files
# Convert using Docker
## Build the Docker image
Use the command below to build the Docker image.
```
docker build --tag hovernet-tf-npz-converter .
```## Run the Docker image on a directory containing TensorFlow checkpoints
The checkpoint directory should contain a graph meta file and an index file. It is
possible that other files will work too, but this is the only setup that has been
tested here.```
checkpoints/
├── graph-N-X.meta
├── ckpt-X.data-00000-of-00001
└── ckpt-X.index
```When running the Docker image, be sure to mount your model directory onto the container.
The command below will save the npz file of weights into the same directory that contains
the TensorFlow checkpoints.```bash
docker run --rm \
--volume $(realpath checkpoints):/checkpoints \
hovernet-tf-npz-converter \
/checkpoints \
/checkpoints/model-weights.npz
```# Convert without Docker
Create an environment with `tensorflow==1.12.0` and `tensorpack==0.9.0.1`
(requires `python<=3.6`) and run the script `convert-tf-to-npz.py`.