add XceptionV1 model data

This commit is contained in:
Leon Chen
2016-10-24 00:49:50 -04:00
parent 39c2bae893
commit 3d49f1afaf
4 changed files with 116 additions and 0 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
+111
View File
@@ -0,0 +1,111 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Xception v1 - ImageNet\n",
"\n",
"see **https://github.com/fchollet/keras/blob/master/keras/applications/xception.py**"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"WEIGHTS_FILEPATH = 'xception.hdf5'\n",
"MODEL_ARCH_FILEPATH = 'xception.json'"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"Using TensorFlow backend.\n"
]
}
],
"source": [
"from keras.applications import xception, imagenet_utils"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Downloading data from https://github.com/fchollet/deep-learning-models/releases/download/v0.4/xception_weights_tf_dim_ordering_tf_kernels.h5\n",
"91889664/91884032 [==============================] - 22s \n"
]
}
],
"source": [
"input_shape = (299, 299, 3)\n",
"\n",
"model = xception.Xception(include_top=True, weights='imagenet')"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"model.save_weights(WEIGHTS_FILEPATH)\n",
"\n",
"with open(MODEL_ARCH_FILEPATH, 'w') as f:\n",
" f.write(model.to_json())"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
"anaconda-cloud": {},
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.5.2"
}
},
"nbformat": 4,
"nbformat_minor": 1
}