Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added export functionality for Keras #85

Merged
merged 14 commits into from Jun 30, 2017
Merged

Added export functionality for Keras #85

merged 14 commits into from Jun 30, 2017

Conversation

utsavgarg
Copy link
Contributor

  • Added functions to calculate output shapes for Keras export
  • Added Data, Conv, Pool, Activation, Dense, Flatten, Dropout layers
  • Tested export of VGG-16

* Added Conv, Input, Pooling, Activation, Dropout and Dense layers
* Tested export of VGG-16
* Added support for BatchNorm and Eltwise layers
* Added concat layer
* Fixed bug with zero padding layer
* Added Reshape and Deconv layers
* Added support for LSTM, SimpleRNN layers
* Added documentation in __init__.py
@coveralls
Copy link

Coverage Status

Coverage decreased (-4.8%) to 78.708% when pulling b36bb9e on utsavgarg:keras into 766451b on Cloud-CV:master.

Copy link
Contributor

@virajprabhu virajprabhu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great overall, good job! Please look at comments. Can we rename layers.py (from the earlier PR) to import_layers.py or something? Can we also test a couple more simple NN's (both import and export) and add to examples? That can be a new PR.

@@ -27760,7 +27760,7 @@
delete netData[layerId].state;
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gitignore?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what you meant here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant we should add bundle.js to gitignore.

elif(net[layerId]['info']['type'] == 'Reshape'):
net[layerId]['shape']['output'] = reshape(net[layerId])

elif(net[layerId]['info']['type'] in ['SPP', 'Crop']):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should throw a "This layer is not supported in Keras" error on the front end for this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay will add exception handling.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good.

params['kernel_w'], params['kernel_h'] = layer.kernel_size
params['stride_w'], params['stride_h'] = layer.strides
params['pad_w'], params['pad_h'] = get_padding(params['kernel_w'], params['kernel_h'],
params['kernel_h'], params['kernel_w'] = layer.kernel_size
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this a mistake in the earlier PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

@utsavgarg
Copy link
Contributor Author

The layers.py was already renamed to layers_import.py in this PR. I have tested VGG-16, Resnet-50 and Inception-v3.

@virajprabhu
Copy link
Contributor

Great, please add everything that you've tested to the examples folder. Would be good to make subfolders for each framework.

@coveralls
Copy link

Coverage Status

Coverage decreased (-4.8%) to 78.708% when pulling 1a6bf1e on utsavgarg:keras into 766451b on Cloud-CV:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-4.8%) to 78.708% when pulling 3c74e12 on utsavgarg:keras into 766451b on Cloud-CV:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-4.8%) to 78.708% when pulling b9bd015 on utsavgarg:keras into 766451b on Cloud-CV:master.

@virajprabhu virajprabhu merged commit 0ef4f93 into Cloud-CV:master Jun 30, 2017
@virajprabhu
Copy link
Contributor

LGTM

@utsavgarg utsavgarg deleted the keras branch June 30, 2017 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants