Skip to main content
Donate to the Python Software Foundation or Purchase a PyCharm License to Benefit the PSF! Donate Now

The deep learning models convertor

Project description


Gluon to Keras deep neural network model converter

Build Status GitHub License Python Version


git clone
cd gluon2keras
pip install -e .

or you can use pip:

pip install gluon2keras


# Get a model from gluon cv
from gluoncv2.model_provider import get_model as glcv2_get_model
net = glcv2_get_model("xception")

# Make sure it's hybrid and initialized

# Test input
input_np = np.random.uniform(0, 1, (1, 3, 299, 299))
gluon_output = net(mx.nd.array(input_np))

# Keras model
k_model = gluon2keras(net, [(1, 3, 299, 299)], verbose=True, names='short')
error = check_error(gluon_output, k_model, input_np)

Code snippets

Look at the tests directory.


This software is covered by MIT License.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
gluon2keras-0.0.1.tar.gz (3.2 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page