{ "cells": [ { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "# Converting PyTorch to ONNX" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "True\n" ] } ], "source": [ "import torch\n", "from torch import nn\n", "from torch.nn import functional as F\n", "\n", "print(torch.cuda.is_available())" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "## Defining the model" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [], "source": [ "class BasicBlock(nn.Module):\n", "\n", " def __init__(self, in_channels, out_channels, stride= 1):\n", " super().__init__()\n", " self.conv1 = nn.Conv2d(in_channels, out_channels, 3, stride= stride, padding= 1)\n", " self.conv2 = nn.Conv2d(out_channels, out_channels, 3, stride= 1, padding= 1)\n", " self.bn1 = nn.BatchNorm2d(out_channels)\n", " self.bn2 = nn.BatchNorm2d(out_channels)\n", " self.relu = nn.ReLU(inplace= True)\n", "\n", " self.downsample = nn.Sequential(nn.Conv2d(in_channels, out_channels, 1))\n", " \n", " if stride != 1:\n", " self.downsample = nn.Sequential(\n", " nn.Conv2d(in_channels, out_channels, 1, stride),\n", " nn.BatchNorm2d(out_channels))\n", "\n", " def forward(self, x):\n", " out = self.conv1(x)\n", " out = self.bn1(out)\n", " out = self.relu(out)\n", "\n", " out = self.conv2(out)\n", " out = self.bn2(out)\n", "\n", " out += self.downsample(x)\n", "\n", " out = self.relu(out)\n", "\n", " return out\n", "\n", "class ResNet34(nn.Module):\n", " def __init__(self, in_channels, num_classes) -> None:\n", " super().__init__()\n", "\n", " self.conv1 = nn.Sequential(nn.Conv2d(in_channels, 64, 7, stride= 2, padding= 3),\n", " nn.BatchNorm2d(64), nn.MaxPool2d(2, stride= 1), nn.ReLU(inplace= True))\n", "\n", " self.layer0 = self._make_layer(64, 64, 3, 1)\n", " self.layer1 = self._make_layer(64, 128, 4, 2)\n", " self.layer2 = self._make_layer(128, 256, 6, 2)\n", " self.layer3 = self._make_layer(256, 512, 3, 2)\n", "\n", " self.avg_pool = nn.AvgPool2d(4)\n", " self.fc = nn.Linear(512, num_classes)\n", "\n", " def _make_layer(self, in_channels, out_channels, num_blocks, stride):\n", " \n", " layers = []\n", " layers.append(BasicBlock(in_channels, out_channels, stride))\n", "\n", " for i in range(num_blocks - 1):\n", " layers.append(BasicBlock(out_channels, out_channels, 1))\n", "\n", " return nn.Sequential(*layers)\n", "\n", " def forward(self, x):\n", " out = self.conv1(x)\n", " \n", " out = self.layer0(out)\n", " out = self.layer1(out)\n", " out = self.layer2(out)\n", " out = self.layer3(out)\n", "\n", " out = self.avg_pool(out)\n", " out = out.view(out.size(0), -1)\n", " out = self.fc(out)\n", "\n", " return out" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "## Loading the model" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [], "source": [ "model = ResNet34(3, 10)\n", "model.load_state_dict(torch.load('../models/model.pth'))\n", "\n", "dummy_input = torch.randn(1, 3, 64, 64)\n", "\n", "model.eval()\n", "torch_out = model(dummy_input)" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "## Converting to ONNX" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Exported graph: graph(%input : Float(*, 3, 64, 64, strides=[12288, 4096, 64, 1], requires_grad=0, device=cpu),\n", " %layer0.0.downsample.0.weight : Float(64, 64, 1, 1, strides=[64, 1, 1, 1], requires_grad=1, device=cpu),\n", " %layer0.0.downsample.0.bias : Float(64, strides=[1], requires_grad=1, device=cpu),\n", " %layer0.1.downsample.0.weight : Float(64, 64, 1, 1, strides=[64, 1, 1, 1], requires_grad=1, device=cpu),\n", " %layer0.1.downsample.0.bias : Float(64, strides=[1], requires_grad=1, device=cpu),\n", " %layer0.2.downsample.0.weight : Float(64, 64, 1, 1, strides=[64, 1, 1, 1], requires_grad=1, device=cpu),\n", " %layer0.2.downsample.0.bias : Float(64, strides=[1], requires_grad=1, device=cpu),\n", " %layer1.1.downsample.0.weight : Float(128, 128, 1, 1, strides=[128, 1, 1, 1], requires_grad=1, device=cpu),\n", " %layer1.1.downsample.0.bias : Float(128, strides=[1], requires_grad=1, device=cpu),\n", " %layer1.2.downsample.0.weight : Float(128, 128, 1, 1, strides=[128, 1, 1, 1], requires_grad=1, device=cpu),\n", " %layer1.2.downsample.0.bias : Float(128, strides=[1], requires_grad=1, device=cpu),\n", " %layer1.3.downsample.0.weight : Float(128, 128, 1, 1, strides=[128, 1, 1, 1], requires_grad=1, device=cpu),\n", " %layer1.3.downsample.0.bias : Float(128, strides=[1], requires_grad=1, device=cpu),\n", " %layer2.1.downsample.0.weight : Float(256, 256, 1, 1, strides=[256, 1, 1, 1], requires_grad=1, device=cpu),\n", " %layer2.1.downsample.0.bias : Float(256, strides=[1], requires_grad=1, device=cpu),\n", " %layer2.2.downsample.0.weight : Float(256, 256, 1, 1, strides=[256, 1, 1, 1], requires_grad=1, device=cpu),\n", " %layer2.2.downsample.0.bias : Float(256, strides=[1], requires_grad=1, device=cpu),\n", " %layer2.3.downsample.0.weight : Float(256, 256, 1, 1, strides=[256, 1, 1, 1], requires_grad=1, device=cpu),\n", " %layer2.3.downsample.0.bias : Float(256, strides=[1], requires_grad=1, device=cpu),\n", " %layer2.4.downsample.0.weight : Float(256, 256, 1, 1, strides=[256, 1, 1, 1], requires_grad=1, device=cpu),\n", " %layer2.4.downsample.0.bias : Float(256, strides=[1], requires_grad=1, device=cpu),\n", " %layer2.5.downsample.0.weight : Float(256, 256, 1, 1, strides=[256, 1, 1, 1], requires_grad=1, device=cpu),\n", " %layer2.5.downsample.0.bias : Float(256, strides=[1], requires_grad=1, device=cpu),\n", " %layer3.1.downsample.0.weight : Float(512, 512, 1, 1, strides=[512, 1, 1, 1], requires_grad=1, device=cpu),\n", " %layer3.1.downsample.0.bias : Float(512, strides=[1], requires_grad=1, device=cpu),\n", " %layer3.2.downsample.0.weight : Float(512, 512, 1, 1, strides=[512, 1, 1, 1], requires_grad=1, device=cpu),\n", " %layer3.2.downsample.0.bias : Float(512, strides=[1], requires_grad=1, device=cpu),\n", " %fc.weight : Float(10, 512, strides=[512, 1], requires_grad=1, device=cpu),\n", " %fc.bias : Float(10, strides=[1], requires_grad=1, device=cpu),\n", " %onnx::Conv_431 : Float(64, 3, 7, 7, strides=[147, 49, 7, 1], requires_grad=0, device=cpu),\n", " %onnx::Conv_432 : Float(64, strides=[1], requires_grad=0, device=cpu),\n", " %onnx::Conv_434 : Float(64, 64, 3, 3, strides=[576, 9, 3, 1], requires_grad=0, device=cpu),\n", " %onnx::Conv_435 : Float(64, strides=[1], requires_grad=0, device=cpu),\n", " %onnx::Conv_437 : Float(64, 64, 3, 3, strides=[576, 9, 3, 1], requires_grad=0, device=cpu),\n", " %onnx::Conv_438 : Float(64, strides=[1], requires_grad=0, device=cpu),\n", " %onnx::Conv_440 : Float(64, 64, 3, 3, strides=[576, 9, 3, 1], requires_grad=0, device=cpu),\n", " %onnx::Conv_441 : Float(64, strides=[1], requires_grad=0, device=cpu),\n", " %onnx::Conv_443 : Float(64, 64, 3, 3, strides=[576, 9, 3, 1], requires_grad=0, device=cpu),\n", " %onnx::Conv_444 : Float(64, strides=[1], requires_grad=0, device=cpu),\n", " %onnx::Conv_446 : Float(64, 64, 3, 3, strides=[576, 9, 3, 1], requires_grad=0, device=cpu),\n", " %onnx::Conv_447 : Float(64, strides=[1], requires_grad=0, device=cpu),\n", " %onnx::Conv_449 : Float(64, 64, 3, 3, strides=[576, 9, 3, 1], requires_grad=0, device=cpu),\n", " %onnx::Conv_450 : Float(64, strides=[1], requires_grad=0, device=cpu),\n", " %onnx::Conv_452 : Float(128, 64, 3, 3, strides=[576, 9, 3, 1], requires_grad=0, device=cpu),\n", " %onnx::Conv_453 : Float(128, strides=[1], requires_grad=0, device=cpu),\n", " %onnx::Conv_455 : Float(128, 128, 3, 3, strides=[1152, 9, 3, 1], requires_grad=0, device=cpu),\n", " %onnx::Conv_456 : Float(128, strides=[1], requires_grad=0, device=cpu),\n", " %onnx::Conv_458 : Float(128, 64, 1, 1, strides=[64, 1, 1, 1], requires_grad=0, device=cpu),\n", " %onnx::Conv_459 : Float(128, strides=[1], requires_grad=0, device=cpu),\n", " %onnx::Conv_461 : Float(128, 128, 3, 3, strides=[1152, 9, 3, 1], requires_grad=0, device=cpu),\n", " %onnx::Conv_462 : Float(128, strides=[1], requires_grad=0, device=cpu),\n", " %onnx::Conv_464 : Float(128, 128, 3, 3, strides=[1152, 9, 3, 1], requires_grad=0, device=cpu),\n", " %onnx::Conv_465 : Float(128, strides=[1], requires_grad=0, device=cpu),\n", " %onnx::Conv_467 : Float(128, 128, 3, 3, strides=[1152, 9, 3, 1], requires_grad=0, device=cpu),\n", " %onnx::Conv_468 : Float(128, strides=[1], requires_grad=0, device=cpu),\n", " %onnx::Conv_470 : Float(128, 128, 3, 3, strides=[1152, 9, 3, 1], requires_grad=0, device=cpu),\n", " %onnx::Conv_471 : Float(128, strides=[1], requires_grad=0, device=cpu),\n", " %onnx::Conv_473 : Float(128, 128, 3, 3, strides=[1152, 9, 3, 1], requires_grad=0, device=cpu),\n", " %onnx::Conv_474 : Float(128, strides=[1], requires_grad=0, device=cpu),\n", " %onnx::Conv_476 : Float(128, 128, 3, 3, strides=[1152, 9, 3, 1], requires_grad=0, device=cpu),\n", " %onnx::Conv_477 : Float(128, strides=[1], requires_grad=0, device=cpu),\n", " %onnx::Conv_479 : Float(256, 128, 3, 3, strides=[1152, 9, 3, 1], requires_grad=0, device=cpu),\n", " %onnx::Conv_480 : Float(256, strides=[1], requires_grad=0, device=cpu),\n", " %onnx::Conv_482 : Float(256, 256, 3, 3, strides=[2304, 9, 3, 1], requires_grad=0, device=cpu),\n", " %onnx::Conv_483 : Float(256, strides=[1], requires_grad=0, device=cpu),\n", " %onnx::Conv_485 : Float(256, 128, 1, 1, strides=[128, 1, 1, 1], requires_grad=0, device=cpu),\n", " %onnx::Conv_486 : Float(256, strides=[1], requires_grad=0, device=cpu),\n", " %onnx::Conv_488 : Float(256, 256, 3, 3, strides=[2304, 9, 3, 1], requires_grad=0, device=cpu),\n", " %onnx::Conv_489 : Float(256, strides=[1], requires_grad=0, device=cpu),\n", " %onnx::Conv_491 : Float(256, 256, 3, 3, strides=[2304, 9, 3, 1], requires_grad=0, device=cpu),\n", " %onnx::Conv_492 : Float(256, strides=[1], requires_grad=0, device=cpu),\n", " %onnx::Conv_494 : Float(256, 256, 3, 3, strides=[2304, 9, 3, 1], requires_grad=0, device=cpu),\n", " %onnx::Conv_495 : Float(256, strides=[1], requires_grad=0, device=cpu),\n", " %onnx::Conv_497 : Float(256, 256, 3, 3, strides=[2304, 9, 3, 1], requires_grad=0, device=cpu),\n", " %onnx::Conv_498 : Float(256, strides=[1], requires_grad=0, device=cpu),\n", " %onnx::Conv_500 : Float(256, 256, 3, 3, strides=[2304, 9, 3, 1], requires_grad=0, device=cpu),\n", " %onnx::Conv_501 : Float(256, strides=[1], requires_grad=0, device=cpu),\n", " %onnx::Conv_503 : Float(256, 256, 3, 3, strides=[2304, 9, 3, 1], requires_grad=0, device=cpu),\n", " %onnx::Conv_504 : Float(256, strides=[1], requires_grad=0, device=cpu),\n", " %onnx::Conv_506 : Float(256, 256, 3, 3, strides=[2304, 9, 3, 1], requires_grad=0, device=cpu),\n", " %onnx::Conv_507 : Float(256, strides=[1], requires_grad=0, device=cpu),\n", " %onnx::Conv_509 : Float(256, 256, 3, 3, strides=[2304, 9, 3, 1], requires_grad=0, device=cpu),\n", " %onnx::Conv_510 : Float(256, strides=[1], requires_grad=0, device=cpu),\n", " %onnx::Conv_512 : Float(256, 256, 3, 3, strides=[2304, 9, 3, 1], requires_grad=0, device=cpu),\n", " %onnx::Conv_513 : Float(256, strides=[1], requires_grad=0, device=cpu),\n", " %onnx::Conv_515 : Float(256, 256, 3, 3, strides=[2304, 9, 3, 1], requires_grad=0, device=cpu),\n", " %onnx::Conv_516 : Float(256, strides=[1], requires_grad=0, device=cpu),\n", " %onnx::Conv_518 : Float(512, 256, 3, 3, strides=[2304, 9, 3, 1], requires_grad=0, device=cpu),\n", " %onnx::Conv_519 : Float(512, strides=[1], requires_grad=0, device=cpu),\n", " %onnx::Conv_521 : Float(512, 512, 3, 3, strides=[4608, 9, 3, 1], requires_grad=0, device=cpu),\n", " %onnx::Conv_522 : Float(512, strides=[1], requires_grad=0, device=cpu),\n", " %onnx::Conv_524 : Float(512, 256, 1, 1, strides=[256, 1, 1, 1], requires_grad=0, device=cpu),\n", " %onnx::Conv_525 : Float(512, strides=[1], requires_grad=0, device=cpu),\n", " %onnx::Conv_527 : Float(512, 512, 3, 3, strides=[4608, 9, 3, 1], requires_grad=0, device=cpu),\n", " %onnx::Conv_528 : Float(512, strides=[1], requires_grad=0, device=cpu),\n", " %onnx::Conv_530 : Float(512, 512, 3, 3, strides=[4608, 9, 3, 1], requires_grad=0, device=cpu),\n", " %onnx::Conv_531 : Float(512, strides=[1], requires_grad=0, device=cpu),\n", " %onnx::Conv_533 : Float(512, 512, 3, 3, strides=[4608, 9, 3, 1], requires_grad=0, device=cpu),\n", " %onnx::Conv_534 : Float(512, strides=[1], requires_grad=0, device=cpu),\n", " %onnx::Conv_536 : Float(512, 512, 3, 3, strides=[4608, 9, 3, 1], requires_grad=0, device=cpu),\n", " %onnx::Conv_537 : Float(512, strides=[1], requires_grad=0, device=cpu)):\n", " %/conv1/conv1.0/Conv_output_0 : Float(*, 64, 32, 32, strides=[65536, 1024, 32, 1], requires_grad=1, device=cpu) = onnx::Conv[dilations=[1, 1], group=1, kernel_shape=[7, 7], pads=[3, 3, 3, 3], strides=[2, 2], onnx_name=\"/conv1/conv1.0/Conv\"](%input, %onnx::Conv_431, %onnx::Conv_432), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::conv1/torch.nn.modules.conv.Conv2d::conv1.0 # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/modules/conv.py:458:0\n", " %/conv1/conv1.2/MaxPool_output_0 : Float(*, 64, 31, 31, strides=[61504, 961, 31, 1], requires_grad=1, device=cpu) = onnx::MaxPool[ceil_mode=0, kernel_shape=[2, 2], pads=[0, 0, 0, 0], strides=[1, 1], onnx_name=\"/conv1/conv1.2/MaxPool\"](%/conv1/conv1.0/Conv_output_0), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::conv1/torch.nn.modules.pooling.MaxPool2d::conv1.2 # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/functional.py:780:0\n", " %/conv1/conv1.3/Relu_output_0 : Float(*, 64, 31, 31, strides=[61504, 961, 31, 1], requires_grad=1, device=cpu) = onnx::Relu[onnx_name=\"/conv1/conv1.3/Relu\"](%/conv1/conv1.2/MaxPool_output_0), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::conv1/torch.nn.modules.activation.ReLU::conv1.3 # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/functional.py:1453:0\n", " %/layer0/layer0.0/conv1/Conv_output_0 : Float(*, 64, 31, 31, strides=[61504, 961, 31, 1], requires_grad=1, device=cpu) = onnx::Conv[dilations=[1, 1], group=1, kernel_shape=[3, 3], pads=[1, 1, 1, 1], strides=[1, 1], onnx_name=\"/layer0/layer0.0/conv1/Conv\"](%/conv1/conv1.3/Relu_output_0, %onnx::Conv_434, %onnx::Conv_435), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer0/__main__.BasicBlock::layer0.0/torch.nn.modules.conv.Conv2d::conv1 # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/modules/conv.py:458:0\n", " %/layer0/layer0.0/relu/Relu_output_0 : Float(*, 64, 31, 31, strides=[61504, 961, 31, 1], requires_grad=1, device=cpu) = onnx::Relu[onnx_name=\"/layer0/layer0.0/relu/Relu\"](%/layer0/layer0.0/conv1/Conv_output_0), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer0/__main__.BasicBlock::layer0.0/torch.nn.modules.activation.ReLU::relu # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/functional.py:1453:0\n", " %/layer0/layer0.0/conv2/Conv_output_0 : Float(*, 64, 31, 31, strides=[61504, 961, 31, 1], requires_grad=1, device=cpu) = onnx::Conv[dilations=[1, 1], group=1, kernel_shape=[3, 3], pads=[1, 1, 1, 1], strides=[1, 1], onnx_name=\"/layer0/layer0.0/conv2/Conv\"](%/layer0/layer0.0/relu/Relu_output_0, %onnx::Conv_437, %onnx::Conv_438), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer0/__main__.BasicBlock::layer0.0/torch.nn.modules.conv.Conv2d::conv2 # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/modules/conv.py:458:0\n", " %/layer0/layer0.0/downsample/downsample.0/Conv_output_0 : Float(*, 64, 31, 31, strides=[61504, 961, 31, 1], requires_grad=0, device=cpu) = onnx::Conv[dilations=[1, 1], group=1, kernel_shape=[1, 1], pads=[0, 0, 0, 0], strides=[1, 1], onnx_name=\"/layer0/layer0.0/downsample/downsample.0/Conv\"](%/conv1/conv1.3/Relu_output_0, %layer0.0.downsample.0.weight, %layer0.0.downsample.0.bias), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer0/__main__.BasicBlock::layer0.0/torch.nn.modules.container.Sequential::downsample/torch.nn.modules.conv.Conv2d::downsample.0 # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/modules/conv.py:458:0\n", " %/layer0/layer0.0/Add_output_0 : Float(*, 64, 31, 31, strides=[61504, 961, 31, 1], requires_grad=1, device=cpu) = onnx::Add[onnx_name=\"/layer0/layer0.0/Add\"](%/layer0/layer0.0/conv2/Conv_output_0, %/layer0/layer0.0/downsample/downsample.0/Conv_output_0), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer0/__main__.BasicBlock::layer0.0 # /tmp/ipykernel_35154/916454948.py:23:0\n", " %/layer0/layer0.0/relu_1/Relu_output_0 : Float(*, 64, 31, 31, strides=[61504, 961, 31, 1], requires_grad=1, device=cpu) = onnx::Relu[onnx_name=\"/layer0/layer0.0/relu_1/Relu\"](%/layer0/layer0.0/Add_output_0), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer0/__main__.BasicBlock::layer0.0/torch.nn.modules.activation.ReLU::relu # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/functional.py:1453:0\n", " %/layer0/layer0.1/conv1/Conv_output_0 : Float(*, 64, 31, 31, strides=[61504, 961, 31, 1], requires_grad=1, device=cpu) = onnx::Conv[dilations=[1, 1], group=1, kernel_shape=[3, 3], pads=[1, 1, 1, 1], strides=[1, 1], onnx_name=\"/layer0/layer0.1/conv1/Conv\"](%/layer0/layer0.0/relu_1/Relu_output_0, %onnx::Conv_440, %onnx::Conv_441), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer0/__main__.BasicBlock::layer0.1/torch.nn.modules.conv.Conv2d::conv1 # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/modules/conv.py:458:0\n", " %/layer0/layer0.1/relu/Relu_output_0 : Float(*, 64, 31, 31, strides=[61504, 961, 31, 1], requires_grad=1, device=cpu) = onnx::Relu[onnx_name=\"/layer0/layer0.1/relu/Relu\"](%/layer0/layer0.1/conv1/Conv_output_0), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer0/__main__.BasicBlock::layer0.1/torch.nn.modules.activation.ReLU::relu # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/functional.py:1453:0\n", " %/layer0/layer0.1/conv2/Conv_output_0 : Float(*, 64, 31, 31, strides=[61504, 961, 31, 1], requires_grad=1, device=cpu) = onnx::Conv[dilations=[1, 1], group=1, kernel_shape=[3, 3], pads=[1, 1, 1, 1], strides=[1, 1], onnx_name=\"/layer0/layer0.1/conv2/Conv\"](%/layer0/layer0.1/relu/Relu_output_0, %onnx::Conv_443, %onnx::Conv_444), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer0/__main__.BasicBlock::layer0.1/torch.nn.modules.conv.Conv2d::conv2 # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/modules/conv.py:458:0\n", " %/layer0/layer0.1/downsample/downsample.0/Conv_output_0 : Float(*, 64, 31, 31, strides=[61504, 961, 31, 1], requires_grad=0, device=cpu) = onnx::Conv[dilations=[1, 1], group=1, kernel_shape=[1, 1], pads=[0, 0, 0, 0], strides=[1, 1], onnx_name=\"/layer0/layer0.1/downsample/downsample.0/Conv\"](%/layer0/layer0.0/relu_1/Relu_output_0, %layer0.1.downsample.0.weight, %layer0.1.downsample.0.bias), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer0/__main__.BasicBlock::layer0.1/torch.nn.modules.container.Sequential::downsample/torch.nn.modules.conv.Conv2d::downsample.0 # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/modules/conv.py:458:0\n", " %/layer0/layer0.1/Add_output_0 : Float(*, 64, 31, 31, strides=[61504, 961, 31, 1], requires_grad=1, device=cpu) = onnx::Add[onnx_name=\"/layer0/layer0.1/Add\"](%/layer0/layer0.1/conv2/Conv_output_0, %/layer0/layer0.1/downsample/downsample.0/Conv_output_0), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer0/__main__.BasicBlock::layer0.1 # /tmp/ipykernel_35154/916454948.py:23:0\n", " %/layer0/layer0.1/relu_1/Relu_output_0 : Float(*, 64, 31, 31, strides=[61504, 961, 31, 1], requires_grad=1, device=cpu) = onnx::Relu[onnx_name=\"/layer0/layer0.1/relu_1/Relu\"](%/layer0/layer0.1/Add_output_0), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer0/__main__.BasicBlock::layer0.1/torch.nn.modules.activation.ReLU::relu # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/functional.py:1453:0\n", " %/layer0/layer0.2/conv1/Conv_output_0 : Float(*, 64, 31, 31, strides=[61504, 961, 31, 1], requires_grad=1, device=cpu) = onnx::Conv[dilations=[1, 1], group=1, kernel_shape=[3, 3], pads=[1, 1, 1, 1], strides=[1, 1], onnx_name=\"/layer0/layer0.2/conv1/Conv\"](%/layer0/layer0.1/relu_1/Relu_output_0, %onnx::Conv_446, %onnx::Conv_447), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer0/__main__.BasicBlock::layer0.2/torch.nn.modules.conv.Conv2d::conv1 # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/modules/conv.py:458:0\n", " %/layer0/layer0.2/relu/Relu_output_0 : Float(*, 64, 31, 31, strides=[61504, 961, 31, 1], requires_grad=1, device=cpu) = onnx::Relu[onnx_name=\"/layer0/layer0.2/relu/Relu\"](%/layer0/layer0.2/conv1/Conv_output_0), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer0/__main__.BasicBlock::layer0.2/torch.nn.modules.activation.ReLU::relu # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/functional.py:1453:0\n", " %/layer0/layer0.2/conv2/Conv_output_0 : Float(*, 64, 31, 31, strides=[61504, 961, 31, 1], requires_grad=1, device=cpu) = onnx::Conv[dilations=[1, 1], group=1, kernel_shape=[3, 3], pads=[1, 1, 1, 1], strides=[1, 1], onnx_name=\"/layer0/layer0.2/conv2/Conv\"](%/layer0/layer0.2/relu/Relu_output_0, %onnx::Conv_449, %onnx::Conv_450), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer0/__main__.BasicBlock::layer0.2/torch.nn.modules.conv.Conv2d::conv2 # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/modules/conv.py:458:0\n", " %/layer0/layer0.2/downsample/downsample.0/Conv_output_0 : Float(*, 64, 31, 31, strides=[61504, 961, 31, 1], requires_grad=0, device=cpu) = onnx::Conv[dilations=[1, 1], group=1, kernel_shape=[1, 1], pads=[0, 0, 0, 0], strides=[1, 1], onnx_name=\"/layer0/layer0.2/downsample/downsample.0/Conv\"](%/layer0/layer0.1/relu_1/Relu_output_0, %layer0.2.downsample.0.weight, %layer0.2.downsample.0.bias), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer0/__main__.BasicBlock::layer0.2/torch.nn.modules.container.Sequential::downsample/torch.nn.modules.conv.Conv2d::downsample.0 # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/modules/conv.py:458:0\n", " %/layer0/layer0.2/Add_output_0 : Float(*, 64, 31, 31, strides=[61504, 961, 31, 1], requires_grad=1, device=cpu) = onnx::Add[onnx_name=\"/layer0/layer0.2/Add\"](%/layer0/layer0.2/conv2/Conv_output_0, %/layer0/layer0.2/downsample/downsample.0/Conv_output_0), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer0/__main__.BasicBlock::layer0.2 # /tmp/ipykernel_35154/916454948.py:23:0\n", " %/layer0/layer0.2/relu_1/Relu_output_0 : Float(*, 64, 31, 31, strides=[61504, 961, 31, 1], requires_grad=1, device=cpu) = onnx::Relu[onnx_name=\"/layer0/layer0.2/relu_1/Relu\"](%/layer0/layer0.2/Add_output_0), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer0/__main__.BasicBlock::layer0.2/torch.nn.modules.activation.ReLU::relu # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/functional.py:1453:0\n", " %/layer1/layer1.0/conv1/Conv_output_0 : Float(*, 128, 16, 16, strides=[32768, 256, 16, 1], requires_grad=1, device=cpu) = onnx::Conv[dilations=[1, 1], group=1, kernel_shape=[3, 3], pads=[1, 1, 1, 1], strides=[2, 2], onnx_name=\"/layer1/layer1.0/conv1/Conv\"](%/layer0/layer0.2/relu_1/Relu_output_0, %onnx::Conv_452, %onnx::Conv_453), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer1/__main__.BasicBlock::layer1.0/torch.nn.modules.conv.Conv2d::conv1 # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/modules/conv.py:458:0\n", " %/layer1/layer1.0/relu/Relu_output_0 : Float(*, 128, 16, 16, strides=[32768, 256, 16, 1], requires_grad=1, device=cpu) = onnx::Relu[onnx_name=\"/layer1/layer1.0/relu/Relu\"](%/layer1/layer1.0/conv1/Conv_output_0), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer1/__main__.BasicBlock::layer1.0/torch.nn.modules.activation.ReLU::relu # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/functional.py:1453:0\n", " %/layer1/layer1.0/conv2/Conv_output_0 : Float(*, 128, 16, 16, strides=[32768, 256, 16, 1], requires_grad=1, device=cpu) = onnx::Conv[dilations=[1, 1], group=1, kernel_shape=[3, 3], pads=[1, 1, 1, 1], strides=[1, 1], onnx_name=\"/layer1/layer1.0/conv2/Conv\"](%/layer1/layer1.0/relu/Relu_output_0, %onnx::Conv_455, %onnx::Conv_456), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer1/__main__.BasicBlock::layer1.0/torch.nn.modules.conv.Conv2d::conv2 # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/modules/conv.py:458:0\n", " %/layer1/layer1.0/downsample/downsample.0/Conv_output_0 : Float(*, 128, 16, 16, strides=[32768, 256, 16, 1], requires_grad=1, device=cpu) = onnx::Conv[dilations=[1, 1], group=1, kernel_shape=[1, 1], pads=[0, 0, 0, 0], strides=[2, 2], onnx_name=\"/layer1/layer1.0/downsample/downsample.0/Conv\"](%/layer0/layer0.2/relu_1/Relu_output_0, %onnx::Conv_458, %onnx::Conv_459), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer1/__main__.BasicBlock::layer1.0/torch.nn.modules.container.Sequential::downsample/torch.nn.modules.conv.Conv2d::downsample.0 # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/modules/conv.py:458:0\n", " %/layer1/layer1.0/Add_output_0 : Float(*, 128, 16, 16, strides=[32768, 256, 16, 1], requires_grad=1, device=cpu) = onnx::Add[onnx_name=\"/layer1/layer1.0/Add\"](%/layer1/layer1.0/conv2/Conv_output_0, %/layer1/layer1.0/downsample/downsample.0/Conv_output_0), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer1/__main__.BasicBlock::layer1.0 # /tmp/ipykernel_35154/916454948.py:23:0\n", " %/layer1/layer1.0/relu_1/Relu_output_0 : Float(*, 128, 16, 16, strides=[32768, 256, 16, 1], requires_grad=1, device=cpu) = onnx::Relu[onnx_name=\"/layer1/layer1.0/relu_1/Relu\"](%/layer1/layer1.0/Add_output_0), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer1/__main__.BasicBlock::layer1.0/torch.nn.modules.activation.ReLU::relu # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/functional.py:1453:0\n", " %/layer1/layer1.1/conv1/Conv_output_0 : Float(*, 128, 16, 16, strides=[32768, 256, 16, 1], requires_grad=1, device=cpu) = onnx::Conv[dilations=[1, 1], group=1, kernel_shape=[3, 3], pads=[1, 1, 1, 1], strides=[1, 1], onnx_name=\"/layer1/layer1.1/conv1/Conv\"](%/layer1/layer1.0/relu_1/Relu_output_0, %onnx::Conv_461, %onnx::Conv_462), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer1/__main__.BasicBlock::layer1.1/torch.nn.modules.conv.Conv2d::conv1 # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/modules/conv.py:458:0\n", " %/layer1/layer1.1/relu/Relu_output_0 : Float(*, 128, 16, 16, strides=[32768, 256, 16, 1], requires_grad=1, device=cpu) = onnx::Relu[onnx_name=\"/layer1/layer1.1/relu/Relu\"](%/layer1/layer1.1/conv1/Conv_output_0), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer1/__main__.BasicBlock::layer1.1/torch.nn.modules.activation.ReLU::relu # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/functional.py:1453:0\n", " %/layer1/layer1.1/conv2/Conv_output_0 : Float(*, 128, 16, 16, strides=[32768, 256, 16, 1], requires_grad=1, device=cpu) = onnx::Conv[dilations=[1, 1], group=1, kernel_shape=[3, 3], pads=[1, 1, 1, 1], strides=[1, 1], onnx_name=\"/layer1/layer1.1/conv2/Conv\"](%/layer1/layer1.1/relu/Relu_output_0, %onnx::Conv_464, %onnx::Conv_465), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer1/__main__.BasicBlock::layer1.1/torch.nn.modules.conv.Conv2d::conv2 # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/modules/conv.py:458:0\n", " %/layer1/layer1.1/downsample/downsample.0/Conv_output_0 : Float(*, 128, 16, 16, strides=[32768, 256, 16, 1], requires_grad=0, device=cpu) = onnx::Conv[dilations=[1, 1], group=1, kernel_shape=[1, 1], pads=[0, 0, 0, 0], strides=[1, 1], onnx_name=\"/layer1/layer1.1/downsample/downsample.0/Conv\"](%/layer1/layer1.0/relu_1/Relu_output_0, %layer1.1.downsample.0.weight, %layer1.1.downsample.0.bias), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer1/__main__.BasicBlock::layer1.1/torch.nn.modules.container.Sequential::downsample/torch.nn.modules.conv.Conv2d::downsample.0 # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/modules/conv.py:458:0\n", " %/layer1/layer1.1/Add_output_0 : Float(*, 128, 16, 16, strides=[32768, 256, 16, 1], requires_grad=1, device=cpu) = onnx::Add[onnx_name=\"/layer1/layer1.1/Add\"](%/layer1/layer1.1/conv2/Conv_output_0, %/layer1/layer1.1/downsample/downsample.0/Conv_output_0), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer1/__main__.BasicBlock::layer1.1 # /tmp/ipykernel_35154/916454948.py:23:0\n", " %/layer1/layer1.1/relu_1/Relu_output_0 : Float(*, 128, 16, 16, strides=[32768, 256, 16, 1], requires_grad=1, device=cpu) = onnx::Relu[onnx_name=\"/layer1/layer1.1/relu_1/Relu\"](%/layer1/layer1.1/Add_output_0), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer1/__main__.BasicBlock::layer1.1/torch.nn.modules.activation.ReLU::relu # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/functional.py:1453:0\n", " %/layer1/layer1.2/conv1/Conv_output_0 : Float(*, 128, 16, 16, strides=[32768, 256, 16, 1], requires_grad=1, device=cpu) = onnx::Conv[dilations=[1, 1], group=1, kernel_shape=[3, 3], pads=[1, 1, 1, 1], strides=[1, 1], onnx_name=\"/layer1/layer1.2/conv1/Conv\"](%/layer1/layer1.1/relu_1/Relu_output_0, %onnx::Conv_467, %onnx::Conv_468), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer1/__main__.BasicBlock::layer1.2/torch.nn.modules.conv.Conv2d::conv1 # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/modules/conv.py:458:0\n", " %/layer1/layer1.2/relu/Relu_output_0 : Float(*, 128, 16, 16, strides=[32768, 256, 16, 1], requires_grad=1, device=cpu) = onnx::Relu[onnx_name=\"/layer1/layer1.2/relu/Relu\"](%/layer1/layer1.2/conv1/Conv_output_0), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer1/__main__.BasicBlock::layer1.2/torch.nn.modules.activation.ReLU::relu # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/functional.py:1453:0\n", " %/layer1/layer1.2/conv2/Conv_output_0 : Float(*, 128, 16, 16, strides=[32768, 256, 16, 1], requires_grad=1, device=cpu) = onnx::Conv[dilations=[1, 1], group=1, kernel_shape=[3, 3], pads=[1, 1, 1, 1], strides=[1, 1], onnx_name=\"/layer1/layer1.2/conv2/Conv\"](%/layer1/layer1.2/relu/Relu_output_0, %onnx::Conv_470, %onnx::Conv_471), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer1/__main__.BasicBlock::layer1.2/torch.nn.modules.conv.Conv2d::conv2 # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/modules/conv.py:458:0\n", " %/layer1/layer1.2/downsample/downsample.0/Conv_output_0 : Float(*, 128, 16, 16, strides=[32768, 256, 16, 1], requires_grad=0, device=cpu) = onnx::Conv[dilations=[1, 1], group=1, kernel_shape=[1, 1], pads=[0, 0, 0, 0], strides=[1, 1], onnx_name=\"/layer1/layer1.2/downsample/downsample.0/Conv\"](%/layer1/layer1.1/relu_1/Relu_output_0, %layer1.2.downsample.0.weight, %layer1.2.downsample.0.bias), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer1/__main__.BasicBlock::layer1.2/torch.nn.modules.container.Sequential::downsample/torch.nn.modules.conv.Conv2d::downsample.0 # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/modules/conv.py:458:0\n", " %/layer1/layer1.2/Add_output_0 : Float(*, 128, 16, 16, strides=[32768, 256, 16, 1], requires_grad=1, device=cpu) = onnx::Add[onnx_name=\"/layer1/layer1.2/Add\"](%/layer1/layer1.2/conv2/Conv_output_0, %/layer1/layer1.2/downsample/downsample.0/Conv_output_0), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer1/__main__.BasicBlock::layer1.2 # /tmp/ipykernel_35154/916454948.py:23:0\n", " %/layer1/layer1.2/relu_1/Relu_output_0 : Float(*, 128, 16, 16, strides=[32768, 256, 16, 1], requires_grad=1, device=cpu) = onnx::Relu[onnx_name=\"/layer1/layer1.2/relu_1/Relu\"](%/layer1/layer1.2/Add_output_0), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer1/__main__.BasicBlock::layer1.2/torch.nn.modules.activation.ReLU::relu # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/functional.py:1453:0\n", " %/layer1/layer1.3/conv1/Conv_output_0 : Float(*, 128, 16, 16, strides=[32768, 256, 16, 1], requires_grad=1, device=cpu) = onnx::Conv[dilations=[1, 1], group=1, kernel_shape=[3, 3], pads=[1, 1, 1, 1], strides=[1, 1], onnx_name=\"/layer1/layer1.3/conv1/Conv\"](%/layer1/layer1.2/relu_1/Relu_output_0, %onnx::Conv_473, %onnx::Conv_474), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer1/__main__.BasicBlock::layer1.3/torch.nn.modules.conv.Conv2d::conv1 # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/modules/conv.py:458:0\n", " %/layer1/layer1.3/relu/Relu_output_0 : Float(*, 128, 16, 16, strides=[32768, 256, 16, 1], requires_grad=1, device=cpu) = onnx::Relu[onnx_name=\"/layer1/layer1.3/relu/Relu\"](%/layer1/layer1.3/conv1/Conv_output_0), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer1/__main__.BasicBlock::layer1.3/torch.nn.modules.activation.ReLU::relu # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/functional.py:1453:0\n", " %/layer1/layer1.3/conv2/Conv_output_0 : Float(*, 128, 16, 16, strides=[32768, 256, 16, 1], requires_grad=1, device=cpu) = onnx::Conv[dilations=[1, 1], group=1, kernel_shape=[3, 3], pads=[1, 1, 1, 1], strides=[1, 1], onnx_name=\"/layer1/layer1.3/conv2/Conv\"](%/layer1/layer1.3/relu/Relu_output_0, %onnx::Conv_476, %onnx::Conv_477), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer1/__main__.BasicBlock::layer1.3/torch.nn.modules.conv.Conv2d::conv2 # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/modules/conv.py:458:0\n", " %/layer1/layer1.3/downsample/downsample.0/Conv_output_0 : Float(*, 128, 16, 16, strides=[32768, 256, 16, 1], requires_grad=0, device=cpu) = onnx::Conv[dilations=[1, 1], group=1, kernel_shape=[1, 1], pads=[0, 0, 0, 0], strides=[1, 1], onnx_name=\"/layer1/layer1.3/downsample/downsample.0/Conv\"](%/layer1/layer1.2/relu_1/Relu_output_0, %layer1.3.downsample.0.weight, %layer1.3.downsample.0.bias), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer1/__main__.BasicBlock::layer1.3/torch.nn.modules.container.Sequential::downsample/torch.nn.modules.conv.Conv2d::downsample.0 # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/modules/conv.py:458:0\n", " %/layer1/layer1.3/Add_output_0 : Float(*, 128, 16, 16, strides=[32768, 256, 16, 1], requires_grad=1, device=cpu) = onnx::Add[onnx_name=\"/layer1/layer1.3/Add\"](%/layer1/layer1.3/conv2/Conv_output_0, %/layer1/layer1.3/downsample/downsample.0/Conv_output_0), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer1/__main__.BasicBlock::layer1.3 # /tmp/ipykernel_35154/916454948.py:23:0\n", " %/layer1/layer1.3/relu_1/Relu_output_0 : Float(*, 128, 16, 16, strides=[32768, 256, 16, 1], requires_grad=1, device=cpu) = onnx::Relu[onnx_name=\"/layer1/layer1.3/relu_1/Relu\"](%/layer1/layer1.3/Add_output_0), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer1/__main__.BasicBlock::layer1.3/torch.nn.modules.activation.ReLU::relu # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/functional.py:1453:0\n", " %/layer2/layer2.0/conv1/Conv_output_0 : Float(*, 256, 8, 8, strides=[16384, 64, 8, 1], requires_grad=1, device=cpu) = onnx::Conv[dilations=[1, 1], group=1, kernel_shape=[3, 3], pads=[1, 1, 1, 1], strides=[2, 2], onnx_name=\"/layer2/layer2.0/conv1/Conv\"](%/layer1/layer1.3/relu_1/Relu_output_0, %onnx::Conv_479, %onnx::Conv_480), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer2/__main__.BasicBlock::layer2.0/torch.nn.modules.conv.Conv2d::conv1 # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/modules/conv.py:458:0\n", " %/layer2/layer2.0/relu/Relu_output_0 : Float(*, 256, 8, 8, strides=[16384, 64, 8, 1], requires_grad=1, device=cpu) = onnx::Relu[onnx_name=\"/layer2/layer2.0/relu/Relu\"](%/layer2/layer2.0/conv1/Conv_output_0), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer2/__main__.BasicBlock::layer2.0/torch.nn.modules.activation.ReLU::relu # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/functional.py:1453:0\n", " %/layer2/layer2.0/conv2/Conv_output_0 : Float(*, 256, 8, 8, strides=[16384, 64, 8, 1], requires_grad=1, device=cpu) = onnx::Conv[dilations=[1, 1], group=1, kernel_shape=[3, 3], pads=[1, 1, 1, 1], strides=[1, 1], onnx_name=\"/layer2/layer2.0/conv2/Conv\"](%/layer2/layer2.0/relu/Relu_output_0, %onnx::Conv_482, %onnx::Conv_483), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer2/__main__.BasicBlock::layer2.0/torch.nn.modules.conv.Conv2d::conv2 # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/modules/conv.py:458:0\n", " %/layer2/layer2.0/downsample/downsample.0/Conv_output_0 : Float(*, 256, 8, 8, strides=[16384, 64, 8, 1], requires_grad=1, device=cpu) = onnx::Conv[dilations=[1, 1], group=1, kernel_shape=[1, 1], pads=[0, 0, 0, 0], strides=[2, 2], onnx_name=\"/layer2/layer2.0/downsample/downsample.0/Conv\"](%/layer1/layer1.3/relu_1/Relu_output_0, %onnx::Conv_485, %onnx::Conv_486), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer2/__main__.BasicBlock::layer2.0/torch.nn.modules.container.Sequential::downsample/torch.nn.modules.conv.Conv2d::downsample.0 # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/modules/conv.py:458:0\n", " %/layer2/layer2.0/Add_output_0 : Float(*, 256, 8, 8, strides=[16384, 64, 8, 1], requires_grad=1, device=cpu) = onnx::Add[onnx_name=\"/layer2/layer2.0/Add\"](%/layer2/layer2.0/conv2/Conv_output_0, %/layer2/layer2.0/downsample/downsample.0/Conv_output_0), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer2/__main__.BasicBlock::layer2.0 # /tmp/ipykernel_35154/916454948.py:23:0\n", " %/layer2/layer2.0/relu_1/Relu_output_0 : Float(*, 256, 8, 8, strides=[16384, 64, 8, 1], requires_grad=1, device=cpu) = onnx::Relu[onnx_name=\"/layer2/layer2.0/relu_1/Relu\"](%/layer2/layer2.0/Add_output_0), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer2/__main__.BasicBlock::layer2.0/torch.nn.modules.activation.ReLU::relu # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/functional.py:1453:0\n", " %/layer2/layer2.1/conv1/Conv_output_0 : Float(*, 256, 8, 8, strides=[16384, 64, 8, 1], requires_grad=1, device=cpu) = onnx::Conv[dilations=[1, 1], group=1, kernel_shape=[3, 3], pads=[1, 1, 1, 1], strides=[1, 1], onnx_name=\"/layer2/layer2.1/conv1/Conv\"](%/layer2/layer2.0/relu_1/Relu_output_0, %onnx::Conv_488, %onnx::Conv_489), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer2/__main__.BasicBlock::layer2.1/torch.nn.modules.conv.Conv2d::conv1 # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/modules/conv.py:458:0\n", " %/layer2/layer2.1/relu/Relu_output_0 : Float(*, 256, 8, 8, strides=[16384, 64, 8, 1], requires_grad=1, device=cpu) = onnx::Relu[onnx_name=\"/layer2/layer2.1/relu/Relu\"](%/layer2/layer2.1/conv1/Conv_output_0), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer2/__main__.BasicBlock::layer2.1/torch.nn.modules.activation.ReLU::relu # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/functional.py:1453:0\n", " %/layer2/layer2.1/conv2/Conv_output_0 : Float(*, 256, 8, 8, strides=[16384, 64, 8, 1], requires_grad=1, device=cpu) = onnx::Conv[dilations=[1, 1], group=1, kernel_shape=[3, 3], pads=[1, 1, 1, 1], strides=[1, 1], onnx_name=\"/layer2/layer2.1/conv2/Conv\"](%/layer2/layer2.1/relu/Relu_output_0, %onnx::Conv_491, %onnx::Conv_492), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer2/__main__.BasicBlock::layer2.1/torch.nn.modules.conv.Conv2d::conv2 # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/modules/conv.py:458:0\n", " %/layer2/layer2.1/downsample/downsample.0/Conv_output_0 : Float(*, 256, 8, 8, strides=[16384, 64, 8, 1], requires_grad=0, device=cpu) = onnx::Conv[dilations=[1, 1], group=1, kernel_shape=[1, 1], pads=[0, 0, 0, 0], strides=[1, 1], onnx_name=\"/layer2/layer2.1/downsample/downsample.0/Conv\"](%/layer2/layer2.0/relu_1/Relu_output_0, %layer2.1.downsample.0.weight, %layer2.1.downsample.0.bias), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer2/__main__.BasicBlock::layer2.1/torch.nn.modules.container.Sequential::downsample/torch.nn.modules.conv.Conv2d::downsample.0 # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/modules/conv.py:458:0\n", " %/layer2/layer2.1/Add_output_0 : Float(*, 256, 8, 8, strides=[16384, 64, 8, 1], requires_grad=1, device=cpu) = onnx::Add[onnx_name=\"/layer2/layer2.1/Add\"](%/layer2/layer2.1/conv2/Conv_output_0, %/layer2/layer2.1/downsample/downsample.0/Conv_output_0), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer2/__main__.BasicBlock::layer2.1 # /tmp/ipykernel_35154/916454948.py:23:0\n", " %/layer2/layer2.1/relu_1/Relu_output_0 : Float(*, 256, 8, 8, strides=[16384, 64, 8, 1], requires_grad=1, device=cpu) = onnx::Relu[onnx_name=\"/layer2/layer2.1/relu_1/Relu\"](%/layer2/layer2.1/Add_output_0), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer2/__main__.BasicBlock::layer2.1/torch.nn.modules.activation.ReLU::relu # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/functional.py:1453:0\n", " %/layer2/layer2.2/conv1/Conv_output_0 : Float(*, 256, 8, 8, strides=[16384, 64, 8, 1], requires_grad=1, device=cpu) = onnx::Conv[dilations=[1, 1], group=1, kernel_shape=[3, 3], pads=[1, 1, 1, 1], strides=[1, 1], onnx_name=\"/layer2/layer2.2/conv1/Conv\"](%/layer2/layer2.1/relu_1/Relu_output_0, %onnx::Conv_494, %onnx::Conv_495), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer2/__main__.BasicBlock::layer2.2/torch.nn.modules.conv.Conv2d::conv1 # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/modules/conv.py:458:0\n", " %/layer2/layer2.2/relu/Relu_output_0 : Float(*, 256, 8, 8, strides=[16384, 64, 8, 1], requires_grad=1, device=cpu) = onnx::Relu[onnx_name=\"/layer2/layer2.2/relu/Relu\"](%/layer2/layer2.2/conv1/Conv_output_0), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer2/__main__.BasicBlock::layer2.2/torch.nn.modules.activation.ReLU::relu # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/functional.py:1453:0\n", " %/layer2/layer2.2/conv2/Conv_output_0 : Float(*, 256, 8, 8, strides=[16384, 64, 8, 1], requires_grad=1, device=cpu) = onnx::Conv[dilations=[1, 1], group=1, kernel_shape=[3, 3], pads=[1, 1, 1, 1], strides=[1, 1], onnx_name=\"/layer2/layer2.2/conv2/Conv\"](%/layer2/layer2.2/relu/Relu_output_0, %onnx::Conv_497, %onnx::Conv_498), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer2/__main__.BasicBlock::layer2.2/torch.nn.modules.conv.Conv2d::conv2 # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/modules/conv.py:458:0\n", " %/layer2/layer2.2/downsample/downsample.0/Conv_output_0 : Float(*, 256, 8, 8, strides=[16384, 64, 8, 1], requires_grad=0, device=cpu) = onnx::Conv[dilations=[1, 1], group=1, kernel_shape=[1, 1], pads=[0, 0, 0, 0], strides=[1, 1], onnx_name=\"/layer2/layer2.2/downsample/downsample.0/Conv\"](%/layer2/layer2.1/relu_1/Relu_output_0, %layer2.2.downsample.0.weight, %layer2.2.downsample.0.bias), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer2/__main__.BasicBlock::layer2.2/torch.nn.modules.container.Sequential::downsample/torch.nn.modules.conv.Conv2d::downsample.0 # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/modules/conv.py:458:0\n", " %/layer2/layer2.2/Add_output_0 : Float(*, 256, 8, 8, strides=[16384, 64, 8, 1], requires_grad=1, device=cpu) = onnx::Add[onnx_name=\"/layer2/layer2.2/Add\"](%/layer2/layer2.2/conv2/Conv_output_0, %/layer2/layer2.2/downsample/downsample.0/Conv_output_0), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer2/__main__.BasicBlock::layer2.2 # /tmp/ipykernel_35154/916454948.py:23:0\n", " %/layer2/layer2.2/relu_1/Relu_output_0 : Float(*, 256, 8, 8, strides=[16384, 64, 8, 1], requires_grad=1, device=cpu) = onnx::Relu[onnx_name=\"/layer2/layer2.2/relu_1/Relu\"](%/layer2/layer2.2/Add_output_0), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer2/__main__.BasicBlock::layer2.2/torch.nn.modules.activation.ReLU::relu # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/functional.py:1453:0\n", " %/layer2/layer2.3/conv1/Conv_output_0 : Float(*, 256, 8, 8, strides=[16384, 64, 8, 1], requires_grad=1, device=cpu) = onnx::Conv[dilations=[1, 1], group=1, kernel_shape=[3, 3], pads=[1, 1, 1, 1], strides=[1, 1], onnx_name=\"/layer2/layer2.3/conv1/Conv\"](%/layer2/layer2.2/relu_1/Relu_output_0, %onnx::Conv_500, %onnx::Conv_501), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer2/__main__.BasicBlock::layer2.3/torch.nn.modules.conv.Conv2d::conv1 # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/modules/conv.py:458:0\n", " %/layer2/layer2.3/relu/Relu_output_0 : Float(*, 256, 8, 8, strides=[16384, 64, 8, 1], requires_grad=1, device=cpu) = onnx::Relu[onnx_name=\"/layer2/layer2.3/relu/Relu\"](%/layer2/layer2.3/conv1/Conv_output_0), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer2/__main__.BasicBlock::layer2.3/torch.nn.modules.activation.ReLU::relu # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/functional.py:1453:0\n", " %/layer2/layer2.3/conv2/Conv_output_0 : Float(*, 256, 8, 8, strides=[16384, 64, 8, 1], requires_grad=1, device=cpu) = onnx::Conv[dilations=[1, 1], group=1, kernel_shape=[3, 3], pads=[1, 1, 1, 1], strides=[1, 1], onnx_name=\"/layer2/layer2.3/conv2/Conv\"](%/layer2/layer2.3/relu/Relu_output_0, %onnx::Conv_503, %onnx::Conv_504), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer2/__main__.BasicBlock::layer2.3/torch.nn.modules.conv.Conv2d::conv2 # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/modules/conv.py:458:0\n", " %/layer2/layer2.3/downsample/downsample.0/Conv_output_0 : Float(*, 256, 8, 8, strides=[16384, 64, 8, 1], requires_grad=0, device=cpu) = onnx::Conv[dilations=[1, 1], group=1, kernel_shape=[1, 1], pads=[0, 0, 0, 0], strides=[1, 1], onnx_name=\"/layer2/layer2.3/downsample/downsample.0/Conv\"](%/layer2/layer2.2/relu_1/Relu_output_0, %layer2.3.downsample.0.weight, %layer2.3.downsample.0.bias), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer2/__main__.BasicBlock::layer2.3/torch.nn.modules.container.Sequential::downsample/torch.nn.modules.conv.Conv2d::downsample.0 # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/modules/conv.py:458:0\n", " %/layer2/layer2.3/Add_output_0 : Float(*, 256, 8, 8, strides=[16384, 64, 8, 1], requires_grad=1, device=cpu) = onnx::Add[onnx_name=\"/layer2/layer2.3/Add\"](%/layer2/layer2.3/conv2/Conv_output_0, %/layer2/layer2.3/downsample/downsample.0/Conv_output_0), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer2/__main__.BasicBlock::layer2.3 # /tmp/ipykernel_35154/916454948.py:23:0\n", " %/layer2/layer2.3/relu_1/Relu_output_0 : Float(*, 256, 8, 8, strides=[16384, 64, 8, 1], requires_grad=1, device=cpu) = onnx::Relu[onnx_name=\"/layer2/layer2.3/relu_1/Relu\"](%/layer2/layer2.3/Add_output_0), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer2/__main__.BasicBlock::layer2.3/torch.nn.modules.activation.ReLU::relu # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/functional.py:1453:0\n", " %/layer2/layer2.4/conv1/Conv_output_0 : Float(*, 256, 8, 8, strides=[16384, 64, 8, 1], requires_grad=1, device=cpu) = onnx::Conv[dilations=[1, 1], group=1, kernel_shape=[3, 3], pads=[1, 1, 1, 1], strides=[1, 1], onnx_name=\"/layer2/layer2.4/conv1/Conv\"](%/layer2/layer2.3/relu_1/Relu_output_0, %onnx::Conv_506, %onnx::Conv_507), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer2/__main__.BasicBlock::layer2.4/torch.nn.modules.conv.Conv2d::conv1 # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/modules/conv.py:458:0\n", " %/layer2/layer2.4/relu/Relu_output_0 : Float(*, 256, 8, 8, strides=[16384, 64, 8, 1], requires_grad=1, device=cpu) = onnx::Relu[onnx_name=\"/layer2/layer2.4/relu/Relu\"](%/layer2/layer2.4/conv1/Conv_output_0), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer2/__main__.BasicBlock::layer2.4/torch.nn.modules.activation.ReLU::relu # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/functional.py:1453:0\n", " %/layer2/layer2.4/conv2/Conv_output_0 : Float(*, 256, 8, 8, strides=[16384, 64, 8, 1], requires_grad=1, device=cpu) = onnx::Conv[dilations=[1, 1], group=1, kernel_shape=[3, 3], pads=[1, 1, 1, 1], strides=[1, 1], onnx_name=\"/layer2/layer2.4/conv2/Conv\"](%/layer2/layer2.4/relu/Relu_output_0, %onnx::Conv_509, %onnx::Conv_510), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer2/__main__.BasicBlock::layer2.4/torch.nn.modules.conv.Conv2d::conv2 # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/modules/conv.py:458:0\n", " %/layer2/layer2.4/downsample/downsample.0/Conv_output_0 : Float(*, 256, 8, 8, strides=[16384, 64, 8, 1], requires_grad=0, device=cpu) = onnx::Conv[dilations=[1, 1], group=1, kernel_shape=[1, 1], pads=[0, 0, 0, 0], strides=[1, 1], onnx_name=\"/layer2/layer2.4/downsample/downsample.0/Conv\"](%/layer2/layer2.3/relu_1/Relu_output_0, %layer2.4.downsample.0.weight, %layer2.4.downsample.0.bias), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer2/__main__.BasicBlock::layer2.4/torch.nn.modules.container.Sequential::downsample/torch.nn.modules.conv.Conv2d::downsample.0 # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/modules/conv.py:458:0\n", " %/layer2/layer2.4/Add_output_0 : Float(*, 256, 8, 8, strides=[16384, 64, 8, 1], requires_grad=1, device=cpu) = onnx::Add[onnx_name=\"/layer2/layer2.4/Add\"](%/layer2/layer2.4/conv2/Conv_output_0, %/layer2/layer2.4/downsample/downsample.0/Conv_output_0), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer2/__main__.BasicBlock::layer2.4 # /tmp/ipykernel_35154/916454948.py:23:0\n", " %/layer2/layer2.4/relu_1/Relu_output_0 : Float(*, 256, 8, 8, strides=[16384, 64, 8, 1], requires_grad=1, device=cpu) = onnx::Relu[onnx_name=\"/layer2/layer2.4/relu_1/Relu\"](%/layer2/layer2.4/Add_output_0), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer2/__main__.BasicBlock::layer2.4/torch.nn.modules.activation.ReLU::relu # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/functional.py:1453:0\n", " %/layer2/layer2.5/conv1/Conv_output_0 : Float(*, 256, 8, 8, strides=[16384, 64, 8, 1], requires_grad=1, device=cpu) = onnx::Conv[dilations=[1, 1], group=1, kernel_shape=[3, 3], pads=[1, 1, 1, 1], strides=[1, 1], onnx_name=\"/layer2/layer2.5/conv1/Conv\"](%/layer2/layer2.4/relu_1/Relu_output_0, %onnx::Conv_512, %onnx::Conv_513), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer2/__main__.BasicBlock::layer2.5/torch.nn.modules.conv.Conv2d::conv1 # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/modules/conv.py:458:0\n", " %/layer2/layer2.5/relu/Relu_output_0 : Float(*, 256, 8, 8, strides=[16384, 64, 8, 1], requires_grad=1, device=cpu) = onnx::Relu[onnx_name=\"/layer2/layer2.5/relu/Relu\"](%/layer2/layer2.5/conv1/Conv_output_0), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer2/__main__.BasicBlock::layer2.5/torch.nn.modules.activation.ReLU::relu # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/functional.py:1453:0\n", " %/layer2/layer2.5/conv2/Conv_output_0 : Float(*, 256, 8, 8, strides=[16384, 64, 8, 1], requires_grad=1, device=cpu) = onnx::Conv[dilations=[1, 1], group=1, kernel_shape=[3, 3], pads=[1, 1, 1, 1], strides=[1, 1], onnx_name=\"/layer2/layer2.5/conv2/Conv\"](%/layer2/layer2.5/relu/Relu_output_0, %onnx::Conv_515, %onnx::Conv_516), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer2/__main__.BasicBlock::layer2.5/torch.nn.modules.conv.Conv2d::conv2 # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/modules/conv.py:458:0\n", " %/layer2/layer2.5/downsample/downsample.0/Conv_output_0 : Float(*, 256, 8, 8, strides=[16384, 64, 8, 1], requires_grad=0, device=cpu) = onnx::Conv[dilations=[1, 1], group=1, kernel_shape=[1, 1], pads=[0, 0, 0, 0], strides=[1, 1], onnx_name=\"/layer2/layer2.5/downsample/downsample.0/Conv\"](%/layer2/layer2.4/relu_1/Relu_output_0, %layer2.5.downsample.0.weight, %layer2.5.downsample.0.bias), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer2/__main__.BasicBlock::layer2.5/torch.nn.modules.container.Sequential::downsample/torch.nn.modules.conv.Conv2d::downsample.0 # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/modules/conv.py:458:0\n", " %/layer2/layer2.5/Add_output_0 : Float(*, 256, 8, 8, strides=[16384, 64, 8, 1], requires_grad=1, device=cpu) = onnx::Add[onnx_name=\"/layer2/layer2.5/Add\"](%/layer2/layer2.5/conv2/Conv_output_0, %/layer2/layer2.5/downsample/downsample.0/Conv_output_0), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer2/__main__.BasicBlock::layer2.5 # /tmp/ipykernel_35154/916454948.py:23:0\n", " %/layer2/layer2.5/relu_1/Relu_output_0 : Float(*, 256, 8, 8, strides=[16384, 64, 8, 1], requires_grad=1, device=cpu) = onnx::Relu[onnx_name=\"/layer2/layer2.5/relu_1/Relu\"](%/layer2/layer2.5/Add_output_0), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer2/__main__.BasicBlock::layer2.5/torch.nn.modules.activation.ReLU::relu # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/functional.py:1453:0\n", " %/layer3/layer3.0/conv1/Conv_output_0 : Float(*, 512, 4, 4, strides=[8192, 16, 4, 1], requires_grad=1, device=cpu) = onnx::Conv[dilations=[1, 1], group=1, kernel_shape=[3, 3], pads=[1, 1, 1, 1], strides=[2, 2], onnx_name=\"/layer3/layer3.0/conv1/Conv\"](%/layer2/layer2.5/relu_1/Relu_output_0, %onnx::Conv_518, %onnx::Conv_519), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer3/__main__.BasicBlock::layer3.0/torch.nn.modules.conv.Conv2d::conv1 # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/modules/conv.py:458:0\n", " %/layer3/layer3.0/relu/Relu_output_0 : Float(*, 512, 4, 4, strides=[8192, 16, 4, 1], requires_grad=1, device=cpu) = onnx::Relu[onnx_name=\"/layer3/layer3.0/relu/Relu\"](%/layer3/layer3.0/conv1/Conv_output_0), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer3/__main__.BasicBlock::layer3.0/torch.nn.modules.activation.ReLU::relu # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/functional.py:1453:0\n", " %/layer3/layer3.0/conv2/Conv_output_0 : Float(*, 512, 4, 4, strides=[8192, 16, 4, 1], requires_grad=1, device=cpu) = onnx::Conv[dilations=[1, 1], group=1, kernel_shape=[3, 3], pads=[1, 1, 1, 1], strides=[1, 1], onnx_name=\"/layer3/layer3.0/conv2/Conv\"](%/layer3/layer3.0/relu/Relu_output_0, %onnx::Conv_521, %onnx::Conv_522), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer3/__main__.BasicBlock::layer3.0/torch.nn.modules.conv.Conv2d::conv2 # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/modules/conv.py:458:0\n", " %/layer3/layer3.0/downsample/downsample.0/Conv_output_0 : Float(*, 512, 4, 4, strides=[8192, 16, 4, 1], requires_grad=1, device=cpu) = onnx::Conv[dilations=[1, 1], group=1, kernel_shape=[1, 1], pads=[0, 0, 0, 0], strides=[2, 2], onnx_name=\"/layer3/layer3.0/downsample/downsample.0/Conv\"](%/layer2/layer2.5/relu_1/Relu_output_0, %onnx::Conv_524, %onnx::Conv_525), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer3/__main__.BasicBlock::layer3.0/torch.nn.modules.container.Sequential::downsample/torch.nn.modules.conv.Conv2d::downsample.0 # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/modules/conv.py:458:0\n", " %/layer3/layer3.0/Add_output_0 : Float(*, 512, 4, 4, strides=[8192, 16, 4, 1], requires_grad=1, device=cpu) = onnx::Add[onnx_name=\"/layer3/layer3.0/Add\"](%/layer3/layer3.0/conv2/Conv_output_0, %/layer3/layer3.0/downsample/downsample.0/Conv_output_0), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer3/__main__.BasicBlock::layer3.0 # /tmp/ipykernel_35154/916454948.py:23:0\n", " %/layer3/layer3.0/relu_1/Relu_output_0 : Float(*, 512, 4, 4, strides=[8192, 16, 4, 1], requires_grad=1, device=cpu) = onnx::Relu[onnx_name=\"/layer3/layer3.0/relu_1/Relu\"](%/layer3/layer3.0/Add_output_0), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer3/__main__.BasicBlock::layer3.0/torch.nn.modules.activation.ReLU::relu # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/functional.py:1453:0\n", " %/layer3/layer3.1/conv1/Conv_output_0 : Float(*, 512, 4, 4, strides=[8192, 16, 4, 1], requires_grad=1, device=cpu) = onnx::Conv[dilations=[1, 1], group=1, kernel_shape=[3, 3], pads=[1, 1, 1, 1], strides=[1, 1], onnx_name=\"/layer3/layer3.1/conv1/Conv\"](%/layer3/layer3.0/relu_1/Relu_output_0, %onnx::Conv_527, %onnx::Conv_528), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer3/__main__.BasicBlock::layer3.1/torch.nn.modules.conv.Conv2d::conv1 # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/modules/conv.py:458:0\n", " %/layer3/layer3.1/relu/Relu_output_0 : Float(*, 512, 4, 4, strides=[8192, 16, 4, 1], requires_grad=1, device=cpu) = onnx::Relu[onnx_name=\"/layer3/layer3.1/relu/Relu\"](%/layer3/layer3.1/conv1/Conv_output_0), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer3/__main__.BasicBlock::layer3.1/torch.nn.modules.activation.ReLU::relu # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/functional.py:1453:0\n", " %/layer3/layer3.1/conv2/Conv_output_0 : Float(*, 512, 4, 4, strides=[8192, 16, 4, 1], requires_grad=1, device=cpu) = onnx::Conv[dilations=[1, 1], group=1, kernel_shape=[3, 3], pads=[1, 1, 1, 1], strides=[1, 1], onnx_name=\"/layer3/layer3.1/conv2/Conv\"](%/layer3/layer3.1/relu/Relu_output_0, %onnx::Conv_530, %onnx::Conv_531), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer3/__main__.BasicBlock::layer3.1/torch.nn.modules.conv.Conv2d::conv2 # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/modules/conv.py:458:0\n", " %/layer3/layer3.1/downsample/downsample.0/Conv_output_0 : Float(*, 512, 4, 4, strides=[8192, 16, 4, 1], requires_grad=0, device=cpu) = onnx::Conv[dilations=[1, 1], group=1, kernel_shape=[1, 1], pads=[0, 0, 0, 0], strides=[1, 1], onnx_name=\"/layer3/layer3.1/downsample/downsample.0/Conv\"](%/layer3/layer3.0/relu_1/Relu_output_0, %layer3.1.downsample.0.weight, %layer3.1.downsample.0.bias), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer3/__main__.BasicBlock::layer3.1/torch.nn.modules.container.Sequential::downsample/torch.nn.modules.conv.Conv2d::downsample.0 # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/modules/conv.py:458:0\n", " %/layer3/layer3.1/Add_output_0 : Float(*, 512, 4, 4, strides=[8192, 16, 4, 1], requires_grad=1, device=cpu) = onnx::Add[onnx_name=\"/layer3/layer3.1/Add\"](%/layer3/layer3.1/conv2/Conv_output_0, %/layer3/layer3.1/downsample/downsample.0/Conv_output_0), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer3/__main__.BasicBlock::layer3.1 # /tmp/ipykernel_35154/916454948.py:23:0\n", " %/layer3/layer3.1/relu_1/Relu_output_0 : Float(*, 512, 4, 4, strides=[8192, 16, 4, 1], requires_grad=1, device=cpu) = onnx::Relu[onnx_name=\"/layer3/layer3.1/relu_1/Relu\"](%/layer3/layer3.1/Add_output_0), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer3/__main__.BasicBlock::layer3.1/torch.nn.modules.activation.ReLU::relu # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/functional.py:1453:0\n", " %/layer3/layer3.2/conv1/Conv_output_0 : Float(*, 512, 4, 4, strides=[8192, 16, 4, 1], requires_grad=1, device=cpu) = onnx::Conv[dilations=[1, 1], group=1, kernel_shape=[3, 3], pads=[1, 1, 1, 1], strides=[1, 1], onnx_name=\"/layer3/layer3.2/conv1/Conv\"](%/layer3/layer3.1/relu_1/Relu_output_0, %onnx::Conv_533, %onnx::Conv_534), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer3/__main__.BasicBlock::layer3.2/torch.nn.modules.conv.Conv2d::conv1 # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/modules/conv.py:458:0\n", " %/layer3/layer3.2/relu/Relu_output_0 : Float(*, 512, 4, 4, strides=[8192, 16, 4, 1], requires_grad=1, device=cpu) = onnx::Relu[onnx_name=\"/layer3/layer3.2/relu/Relu\"](%/layer3/layer3.2/conv1/Conv_output_0), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer3/__main__.BasicBlock::layer3.2/torch.nn.modules.activation.ReLU::relu # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/functional.py:1453:0\n", " %/layer3/layer3.2/conv2/Conv_output_0 : Float(*, 512, 4, 4, strides=[8192, 16, 4, 1], requires_grad=1, device=cpu) = onnx::Conv[dilations=[1, 1], group=1, kernel_shape=[3, 3], pads=[1, 1, 1, 1], strides=[1, 1], onnx_name=\"/layer3/layer3.2/conv2/Conv\"](%/layer3/layer3.2/relu/Relu_output_0, %onnx::Conv_536, %onnx::Conv_537), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer3/__main__.BasicBlock::layer3.2/torch.nn.modules.conv.Conv2d::conv2 # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/modules/conv.py:458:0\n", " %/layer3/layer3.2/downsample/downsample.0/Conv_output_0 : Float(*, 512, 4, 4, strides=[8192, 16, 4, 1], requires_grad=0, device=cpu) = onnx::Conv[dilations=[1, 1], group=1, kernel_shape=[1, 1], pads=[0, 0, 0, 0], strides=[1, 1], onnx_name=\"/layer3/layer3.2/downsample/downsample.0/Conv\"](%/layer3/layer3.1/relu_1/Relu_output_0, %layer3.2.downsample.0.weight, %layer3.2.downsample.0.bias), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer3/__main__.BasicBlock::layer3.2/torch.nn.modules.container.Sequential::downsample/torch.nn.modules.conv.Conv2d::downsample.0 # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/modules/conv.py:458:0\n", " %/layer3/layer3.2/Add_output_0 : Float(*, 512, 4, 4, strides=[8192, 16, 4, 1], requires_grad=1, device=cpu) = onnx::Add[onnx_name=\"/layer3/layer3.2/Add\"](%/layer3/layer3.2/conv2/Conv_output_0, %/layer3/layer3.2/downsample/downsample.0/Conv_output_0), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer3/__main__.BasicBlock::layer3.2 # /tmp/ipykernel_35154/916454948.py:23:0\n", " %/layer3/layer3.2/relu_1/Relu_output_0 : Float(*, 512, 4, 4, strides=[8192, 16, 4, 1], requires_grad=1, device=cpu) = onnx::Relu[onnx_name=\"/layer3/layer3.2/relu_1/Relu\"](%/layer3/layer3.2/Add_output_0), scope: __main__.ResNet34::/torch.nn.modules.container.Sequential::layer3/__main__.BasicBlock::layer3.2/torch.nn.modules.activation.ReLU::relu # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/functional.py:1453:0\n", " %/avg_pool/Constant_output_0 : Long(8, strides=[1], device=cpu) = onnx::Constant[value= 0 0 0 0 0 0 0 0 [ CPULongType{8} ], onnx_name=\"/avg_pool/Constant\"](), scope: __main__.ResNet34::/torch.nn.modules.pooling.AvgPool2d::avg_pool # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/modules/pooling.py:628:0\n", " %/avg_pool/Pad_output_0 : Float(*, 512, 4, 4, device=cpu) = onnx::Pad[mode=\"constant\", onnx_name=\"/avg_pool/Pad\"](%/layer3/layer3.2/relu_1/Relu_output_0, %/avg_pool/Constant_output_0), scope: __main__.ResNet34::/torch.nn.modules.pooling.AvgPool2d::avg_pool # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/modules/pooling.py:628:0\n", " %/avg_pool/AveragePool_output_0 : Float(*, 512, 1, 1, strides=[512, 1, 1, 1], requires_grad=1, device=cpu) = onnx::AveragePool[ceil_mode=0, kernel_shape=[4, 4], pads=[0, 0, 0, 0], strides=[4, 4], onnx_name=\"/avg_pool/AveragePool\"](%/avg_pool/Pad_output_0), scope: __main__.ResNet34::/torch.nn.modules.pooling.AvgPool2d::avg_pool # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/modules/pooling.py:628:0\n", " %/Shape_output_0 : Long(4, strides=[1], device=cpu) = onnx::Shape[onnx_name=\"/Shape\"](%/avg_pool/AveragePool_output_0), scope: __main__.ResNet34:: # /tmp/ipykernel_35154/916454948.py:62:0\n", " %/Constant_output_0 : Long(device=cpu) = onnx::Constant[value={0}, onnx_name=\"/Constant\"](), scope: __main__.ResNet34:: # /tmp/ipykernel_35154/916454948.py:62:0\n", " %/Gather_output_0 : Long(device=cpu) = onnx::Gather[axis=0, onnx_name=\"/Gather\"](%/Shape_output_0, %/Constant_output_0), scope: __main__.ResNet34:: # /tmp/ipykernel_35154/916454948.py:62:0\n", " %onnx::Unsqueeze_423 : Long(1, strides=[1], device=cpu) = onnx::Constant[value={0}]()\n", " %/Unsqueeze_output_0 : Long(1, strides=[1], device=cpu) = onnx::Unsqueeze[onnx_name=\"/Unsqueeze\"](%/Gather_output_0, %onnx::Unsqueeze_423), scope: __main__.ResNet34::\n", " %/Constant_1_output_0 : Long(1, strides=[1], requires_grad=0, device=cpu) = onnx::Constant[value={-1}, onnx_name=\"/Constant_1\"](), scope: __main__.ResNet34::\n", " %/Concat_output_0 : Long(2, strides=[1], device=cpu) = onnx::Concat[axis=0, onnx_name=\"/Concat\"](%/Unsqueeze_output_0, %/Constant_1_output_0), scope: __main__.ResNet34:: # /tmp/ipykernel_35154/916454948.py:62:0\n", " %/Reshape_output_0 : Float(*, 512, strides=[512, 1], requires_grad=1, device=cpu) = onnx::Reshape[allowzero=0, onnx_name=\"/Reshape\"](%/avg_pool/AveragePool_output_0, %/Concat_output_0), scope: __main__.ResNet34:: # /tmp/ipykernel_35154/916454948.py:62:0\n", " %output : Float(*, 10, strides=[10, 1], requires_grad=1, device=cpu) = onnx::Gemm[alpha=1., beta=1., transB=1, onnx_name=\"/fc/Gemm\"](%/Reshape_output_0, %fc.weight, %fc.bias), scope: __main__.ResNet34::/torch.nn.modules.linear.Linear::fc # /home/gautham/.local/lib/python3.10/site-packages/torch/nn/modules/linear.py:114:0\n", " return (%output)\n", "\n" ] } ], "source": [ "onnx_path = '../models/model.onnx'\n", "\n", "torch.onnx.export(model,\n", " dummy_input,\n", " onnx_path,\n", " verbose=True,\n", " input_names = ['input'], # the model's input names\n", " output_names = ['output'], # the model's output names\n", " dynamic_axes={'input' : {0 : 'batch_size'}, # variable length axes\n", " 'output' : {0 : 'batch_size'}})" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "## Verifying the ONNX model" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [], "source": [ "import onnx\n", "\n", "onnx_model = onnx.load(onnx_path)\n", "onnx.checker.check_model(onnx_model)" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "## Comparing ONNX Runtime and PyTorch results" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Exported model has been tested with ONNXRuntime, and the result looks good!\n" ] } ], "source": [ "import onnxruntime\n", "import numpy as np\n", "\n", "ort_session = onnxruntime.InferenceSession(onnx_path)\n", "\n", "def to_numpy(tensor):\n", " return tensor.detach().cpu().numpy() if tensor.requires_grad else tensor.cpu().numpy()\n", "\n", "ort_inputs = {ort_session.get_inputs()[0].name: to_numpy(dummy_input)}\n", "ort_outs = ort_session.run(None, ort_inputs)\n", "\n", "np.testing.assert_allclose(to_numpy(torch_out), ort_outs[0], rtol=1e-03, atol=1e-05)\n", "\n", "print(\"Exported model has been tested with ONNXRuntime, and the result looks good!\")\n" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3.10.6 64-bit", "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.10.6" }, "orig_nbformat": 4, "vscode": { "interpreter": { "hash": "916dbcbb3f70747c44a77c7bcd40155683ae19c65e1c03b4aa3499c5328201f1" } } }, "nbformat": 4, "nbformat_minor": 2 }