Files
fast-depth-tf/train.ipynb

112 lines
2.0 KiB
Plaintext

{
"metadata": {
"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.8.8-final"
},
"orig_nbformat": 2,
"kernelspec": {
"name": "python3",
"display_name": "Python 3.8.8 64-bit ('tensorflow2': conda)",
"metadata": {
"interpreter": {
"hash": "ee99f7bd678359d45d92ad289bdab8f6bcfaae579cfd1bff07d2bb16d7ba024f"
}
}
}
},
"nbformat": 4,
"nbformat_minor": 2,
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import fast_depth_functional as fd"
]
},
{
"source": [
"### Windows GPU Fix"
],
"cell_type": "markdown",
"metadata": {}
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"1 Physical GPUs, 1 Logical GPUs\n"
]
}
],
"source": [
"fd.fix_windows_gpu()"
]
},
{
"source": [
"## Create and compile the model"
],
"cell_type": "markdown",
"metadata": {}
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"model = fd.mobilenet_nnconv5(weights='imagenet')\n",
"fd.compile(model)"
]
},
{
"source": [
"## Train the model using the nyu_v2 dataset (default, huge download)"
],
"cell_type": "markdown",
"metadata": {}
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"fd.train(existing_model=model, save_file='../fast-depth-experimental')"
]
},
{
"source": [
"## Evaluate the trained model"
],
"cell_type": "markdown",
"metadata": {}
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"fd.evaluate(model)"
]
}
]
}