Created
January 30, 2020 02:26
-
-
Save ResidentMario/6d8b5672470c68f02e2412990f64de27 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "code", | |
"execution_count": 1, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"Writing model_12.py\n" | |
] | |
} | |
], | |
"source": [ | |
"%%writefile model_12.py\n", | |
"\n", | |
"# All of the code below is included in the model_12.py\n", | |
"\n", | |
"# I like to put a comment at the top of the file explaining\n", | |
"# how this model is different from the previous one.\n", | |
"\n", | |
"import torch\n", | |
"def train():\n", | |
" # model training code\n", | |
" model.save('model.pt')\n", | |
"\n", | |
"train()" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 2, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"model_12.py\r\n" | |
] | |
} | |
], | |
"source": [ | |
"!ls | grep model_12.py" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 3, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"!spell run --machine-type V100x2\\\n", | |
" --pip torch\\>=1.0.0\\\n", | |
" --pip scikit-image\\\n", | |
" --pip torchvision\\\n", | |
" --mount uploads/bob_ross_segmented_v4:/spell/bob_ross_segmented\\\n", | |
" 'cd models; python model_12.py'" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 4, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"!spell cp runs/62/checkpoints/ /tmp/checkpoints" | |
] | |
} | |
], | |
"metadata": { | |
"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.7.3" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 2 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment