diff --git a/src/notebooks/convert.ipynb b/src/notebooks/convert.ipynb deleted file mode 100644 index d12409b..0000000 --- a/src/notebooks/convert.ipynb +++ /dev/null @@ -1,112 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": 1, - "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "/home/laurent_fainsin/Documents/unet/.venv/lib/python3.8/site-packages/tqdm/auto.py:22: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n", - " from .autonotebook import tqdm as notebook_tqdm\n" - ] - } - ], - "source": [ - "import torch\n", - "from unet.model import UNet\n" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": {}, - "outputs": [], - "source": [ - "net = UNet(\n", - " n_channels=3,\n", - " n_classes=1,\n", - " features=[8, 16, 32, 64],\n", - ")\n" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "" - ] - }, - "execution_count": 5, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "net.load_state_dict(\n", - " torch.load(\"../../checkpoints/best.pth\", map_location=torch.device('cpu'))\n", - ")\n" - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "metadata": {}, - "outputs": [], - "source": [ - "dummy_input = torch.randn(1, 3, 512, 512, requires_grad=True)\n", - "torch.onnx.export(\n", - " net,\n", - " dummy_input,\n", - " \"../../checkpoints/best-fixed.onnx\",\n", - " opset_version=10,\n", - " # input_names=[\"input\"],\n", - " # output_names=[\"output\"],\n", - " # dynamic_axes={\n", - " # \"input\": {\n", - " # 2: \"height\",\n", - " # 3: \"width\",\n", - " # },\n", - " # \"output\": {\n", - " # 2: \"height\",\n", - " # 3: \"width\",\n", - " # },\n", - " # },\n", - ")\n" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3.8.0 ('.venv': poetry)", - "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.8.0" - }, - "orig_nbformat": 4, - "vscode": { - "interpreter": { - "hash": "dc80d2c03865715c8671359a6bf138f6c8ae4e26ae025f2543e0980b8db0ed7e" - } - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} diff --git a/src/notebooks/convert.ipynb.REMOVED.git-id b/src/notebooks/convert.ipynb.REMOVED.git-id new file mode 100644 index 0000000..fa5f3c7 --- /dev/null +++ b/src/notebooks/convert.ipynb.REMOVED.git-id @@ -0,0 +1 @@ +dbe91cbc0788d93595dac272825aa57412f04d70 \ No newline at end of file diff --git a/src/notebooks/predict.ipynb.REMOVED.git-id b/src/notebooks/predict.ipynb.REMOVED.git-id index 9012cc5..e2538a4 100644 --- a/src/notebooks/predict.ipynb.REMOVED.git-id +++ b/src/notebooks/predict.ipynb.REMOVED.git-id @@ -1 +1 @@ -3abcdffb1cbc384de89a39b26f5f57b7472df478 \ No newline at end of file +df787682f8ee4387834b713d1d48437b94d45f61 \ No newline at end of file