{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"# This Python 3 environment comes with many helpful analytics libraries installed\n# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python\n# For example, here's several helpful packages to load\n\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\n\n# Input data files are available in the read-only \"../input/\" directory\n# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory\n\nimport os\nfor dirname, _, filenames in os.walk('/kaggle/input'):\n    for filename in filenames:\n        print(os.path.join(dirname, filename))\n\n# You can write up to 20GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using \"Save & Run All\" \n# You can also write temporary files to /kaggle/temp/, but they won't be saved outside of the current session","metadata":{"_uuid":"1e37b76b-fa0f-47e7-a85f-33c5707c1d62","_cell_guid":"6e67a7c6-6d50-41ac-8a2b-c83a3f2d122f","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-03-22T09:26:13.252564Z","iopub.execute_input":"2022-03-22T09:26:13.253322Z","iopub.status.idle":"2022-03-22T09:26:13.294701Z","shell.execute_reply.started":"2022-03-22T09:26:13.25321Z","shell.execute_reply":"2022-03-22T09:26:13.29357Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Check if GPU is available\nimport torch\ndev = torch.device(\"cuda\") if torch.cuda.is_available() else torch.device(\"cpu\")\n\n# dev = torch.device(\"cpu\")","metadata":{"execution":{"iopub.status.busy":"2022-03-22T09:26:13.297052Z","iopub.execute_input":"2022-03-22T09:26:13.298234Z","iopub.status.idle":"2022-03-22T09:26:15.047291Z","shell.execute_reply.started":"2022-03-22T09:26:13.298176Z","shell.execute_reply":"2022-03-22T09:26:15.046336Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## Initialize the Train and Test Sets","metadata":{"_uuid":"a4277be5-0584-46dd-a770-0293459e3f2b","_cell_guid":"6c0426b1-17d6-4821-915b-105919e5d131","trusted":true}},{"cell_type":"code","source":"train_data_df = pd.read_csv('/kaggle/input/digit-recognizer/train.csv')\ntest_data_df = pd.read_csv('/kaggle/input/digit-recognizer/test.csv')","metadata":{"_uuid":"126d9118-1c91-48d9-b2af-b2a99aee78bb","_cell_guid":"244e393a-b85b-4715-a817-013bc638e0e9","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-03-22T09:26:15.049655Z","iopub.execute_input":"2022-03-22T09:26:15.05031Z","iopub.status.idle":"2022-03-22T09:26:22.079729Z","shell.execute_reply.started":"2022-03-22T09:26:15.050265Z","shell.execute_reply":"2022-03-22T09:26:22.078796Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(\"Train Data shape=\",train_data_df.shape)\nprint(\"Test Data shape=\", test_data_df.shape)","metadata":{"_uuid":"5d3d625c-5307-4c14-9a76-f10e39101a06","_cell_guid":"a9a67413-20bc-4dce-b19f-93ec221ac774","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-03-22T09:26:22.082579Z","iopub.execute_input":"2022-03-22T09:26:22.08292Z","iopub.status.idle":"2022-03-22T09:26:22.08923Z","shell.execute_reply.started":"2022-03-22T09:26:22.082875Z","shell.execute_reply":"2022-03-22T09:26:22.088176Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(test_data_df)","metadata":{"_uuid":"fe14dbc7-e6a9-49cd-9e0c-cccd7bea6733","_cell_guid":"b0d28be5-6242-4f4e-aa63-35c066c0b634","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-03-22T09:26:22.091033Z","iopub.execute_input":"2022-03-22T09:26:22.091731Z","iopub.status.idle":"2022-03-22T09:26:22.115732Z","shell.execute_reply.started":"2022-03-22T09:26:22.091688Z","shell.execute_reply":"2022-03-22T09:26:22.114799Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# [Train Data : Validation Data] Ratio = 80% : 20%\ntrain_data_ratio = 0.80\ntrain_data_size = int(train_data_df.shape[0] * train_data_ratio)\n# Training data\ntrain_X = train_data_df.iloc[:train_data_size,1:]\ntrain_Y = train_data_df[:train_data_size]['label']\n\n# Validation data\nval_X = train_data_df.iloc[train_data_size:,1:]\nval_Y = train_data_df[train_data_size:]['label']\n\n# Test data\ntest_X = test_data_df","metadata":{"_uuid":"c529572a-09e2-4385-9d38-a4b1d8aee986","_cell_guid":"915e906d-f3b6-4b36-ac2a-6766bc7cdf42","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-03-22T09:26:22.11715Z","iopub.execute_input":"2022-03-22T09:26:22.117538Z","iopub.status.idle":"2022-03-22T09:26:22.128539Z","shell.execute_reply.started":"2022-03-22T09:26:22.117491Z","shell.execute_reply":"2022-03-22T09:26:22.127447Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(train_X.shape)\nprint(train_Y.shape)\nprint(val_X.shape)\nprint(val_Y.shape)\n\nprint(type(train_X))","metadata":{"_uuid":"0575eeb9-21aa-4693-bc96-4bffb1082cf1","_cell_guid":"0b389aae-b2a6-4c7a-b3e5-ba7f9a49849c","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-03-22T09:26:22.130261Z","iopub.execute_input":"2022-03-22T09:26:22.131277Z","iopub.status.idle":"2022-03-22T09:26:22.142083Z","shell.execute_reply.started":"2022-03-22T09:26:22.131231Z","shell.execute_reply":"2022-03-22T09:26:22.140814Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(train_X.iloc[0])","metadata":{"_uuid":"f6433ca5-73f9-4257-b34d-ff2a2d4574ae","_cell_guid":"e3e825c2-e474-4b81-b625-4abafcc98c51","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-03-22T09:26:22.143942Z","iopub.execute_input":"2022-03-22T09:26:22.144417Z","iopub.status.idle":"2022-03-22T09:26:22.153157Z","shell.execute_reply.started":"2022-03-22T09:26:22.144371Z","shell.execute_reply":"2022-03-22T09:26:22.152066Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from matplotlib import pyplot\n\npyplot.imshow(train_X.iloc[1].to_numpy().reshape((28, 28)), cmap=\"gray\")","metadata":{"_uuid":"4540cc0c-ea23-4366-8de0-7bc73ad96949","_cell_guid":"a43fb8be-0b45-4fa5-91b5-84a5a3293894","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-03-22T09:26:22.154655Z","iopub.execute_input":"2022-03-22T09:26:22.15579Z","iopub.status.idle":"2022-03-22T09:26:22.415655Z","shell.execute_reply.started":"2022-03-22T09:26:22.155711Z","shell.execute_reply":"2022-03-22T09:26:22.41471Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import torch\n\nx_train_tensor, y_train_tensor, x_valid_tensor, y_valid_tensor = map(\n    torch.tensor, (train_X.to_numpy(), train_Y.to_numpy(), val_X.to_numpy(), val_Y.to_numpy())\n    )","metadata":{"_uuid":"eaaddc08-3b91-40cb-987b-f5ac37c2974c","_cell_guid":"9310fb49-7284-413f-a0cd-43fd5dd5353c","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-03-22T09:26:22.42011Z","iopub.execute_input":"2022-03-22T09:26:22.4208Z","iopub.status.idle":"2022-03-22T09:26:22.681417Z","shell.execute_reply.started":"2022-03-22T09:26:22.420757Z","shell.execute_reply":"2022-03-22T09:26:22.680325Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(x_train_tensor.shape)\nprint(type(x_train_tensor))","metadata":{"_uuid":"701abf4e-95b3-4aa0-bc70-fa40a2c11b93","_cell_guid":"647c225f-312a-4dd1-a54c-40285590888c","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-03-22T09:26:22.683413Z","iopub.execute_input":"2022-03-22T09:26:22.683831Z","iopub.status.idle":"2022-03-22T09:26:22.690656Z","shell.execute_reply.started":"2022-03-22T09:26:22.68376Z","shell.execute_reply":"2022-03-22T09:26:22.689659Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from torch import nn\nimport torch.nn.functional as F\n\nclass Mnist_CNN(nn.Module):\n    def __init__(self):\n        super().__init__()\n        self.conv1 = nn.Conv2d(1, 16, kernel_size=3, stride=2, padding=1)\n        self.conv2 = nn.Conv2d(16, 16, kernel_size=3, stride=2, padding=1)\n        self.conv3 = nn.Conv2d(16, 10, kernel_size=3, stride=2, padding=1)\n        \n    def forward(self, xb):\n        xb = xb.view(-1, 1, 28, 28) # Reshape 784 size vector to 28x28 matrix\n        xb = F.relu(self.conv1(xb))\n        xb = F.relu(self.conv2(xb))\n        xb = F.relu(self.conv3(xb))\n        xb = F.avg_pool2d(xb, 4)\n        return xb.view(-1, xb.size(1))","metadata":{"_uuid":"3f63a2a4-5c66-4073-a550-54d1be326cf7","_cell_guid":"b4a56a64-25b1-4305-9a3e-061cf8cef20b","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-03-22T09:26:22.692367Z","iopub.execute_input":"2022-03-22T09:26:22.693103Z","iopub.status.idle":"2022-03-22T09:26:22.70592Z","shell.execute_reply.started":"2022-03-22T09:26:22.693051Z","shell.execute_reply":"2022-03-22T09:26:22.70483Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"learning_rate = 0.1\nbatch_size = 64\nepochs = 10\nloss_func = F.cross_entropy","metadata":{"_uuid":"c1c02913-e9b8-4dde-818f-62a7a0fe5583","_cell_guid":"593aa19f-6e07-4609-a85d-fb6cee1c099f","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-03-22T09:26:22.707823Z","iopub.execute_input":"2022-03-22T09:26:22.70822Z","iopub.status.idle":"2022-03-22T09:26:22.718077Z","shell.execute_reply.started":"2022-03-22T09:26:22.708144Z","shell.execute_reply":"2022-03-22T09:26:22.71659Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from torch import optim\n\ndef get_model(learning_rate):\n    model = Mnist_CNN()\n    model.to(dev)\n    return model, optim.SGD(model.parameters(), lr=learning_rate, momentum=0.9)","metadata":{"_uuid":"55bc0456-7375-4eb5-85ff-2439899f4ab4","_cell_guid":"dd25b895-bbd4-4727-922f-f420aad06de0","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-03-22T09:26:22.720045Z","iopub.execute_input":"2022-03-22T09:26:22.720397Z","iopub.status.idle":"2022-03-22T09:26:22.729319Z","shell.execute_reply.started":"2022-03-22T09:26:22.720354Z","shell.execute_reply":"2022-03-22T09:26:22.728013Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def accuracy(out, yb):\n    preds = torch.argmax(out, dim=1)\n    return (preds == yb).float().mean()","metadata":{"_uuid":"5bb4e8cf-fade-455a-9d82-13b9cc4ad88c","_cell_guid":"eaf47f67-845a-45e8-a848-3b7eb8ad9760","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-03-22T09:26:22.731366Z","iopub.execute_input":"2022-03-22T09:26:22.731762Z","iopub.status.idle":"2022-03-22T09:26:22.740199Z","shell.execute_reply.started":"2022-03-22T09:26:22.731687Z","shell.execute_reply":"2022-03-22T09:26:22.739009Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def loss_batch(model, loss_func, xb, yb, opt=None):\n    xb = xb.to(dev)\n    yb = yb.to(dev)\n    loss = loss_func(model(xb), yb)\n    \n    if opt is not None:\n        loss.backward()\n        opt.step()\n        opt.zero_grad()\n        \n    return loss.item(), len(xb)","metadata":{"_uuid":"235eb66c-8bcd-493b-b11a-d37ae90efb50","_cell_guid":"ad0bd6db-9872-49ad-a129-07f17f71996e","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-03-22T09:26:22.742079Z","iopub.execute_input":"2022-03-22T09:26:22.742467Z","iopub.status.idle":"2022-03-22T09:26:22.750899Z","shell.execute_reply.started":"2022-03-22T09:26:22.742423Z","shell.execute_reply":"2022-03-22T09:26:22.74973Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import numpy as np\nfrom torch.utils.data import TensorDataset\nfrom torch.utils.data import DataLoader\nimport time\n\n# print(x_train_tensor)\ntrain_ds = TensorDataset(x_train_tensor.float(), y_train_tensor)\nvalid_ds = TensorDataset(x_valid_tensor.float(), y_valid_tensor)\n# print(train_ds)\n\ndef get_data(train_ds, valid_ds, batch_size):\n    return (\n        DataLoader(train_ds, batch_size=batch_size, shuffle=True),\n        DataLoader(valid_ds, batch_size=batch_size*2)\n    )\n\ndef fit(epochs, model, loss_func, opt, train_dl, valid_dl):\n    timings = []\n    for epoch in range(epochs):\n        input_shape = 0\n        model.train()\n        start_time = time.time()\n        for xb, yb in train_dl:\n            loss_batch(model, loss_func, xb, yb, opt)\n            input_shape += xb.shape[0]\n        end_time = time.time()\n        timings.append(end_time - start_time)\n#         print('~~>Average throughput: %.2f images/second'%(input_shape/(end_time - start_time)))\n        model.eval()\n        \n        with torch.no_grad():\n            losses, nums = zip(*[loss_batch(model, loss_func, xb, yb) for xb, yb in valid_dl])\n            val_loss = np.sum(np.multiply(losses, nums))/np.sum(nums)\n            \n        print(epoch, val_loss)\n        print('avg epoch time %.2f ms'%(np.mean(timings)*1000))\n        print('Average throughput: %.2f images/second'%(input_shape/np.mean(timings)))","metadata":{"_uuid":"2a3baf0e-209f-4716-a9d4-ffe1d3d074de","_cell_guid":"06a61b95-1c97-4d57-8c32-5fc9e7ffddff","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-03-22T09:26:22.752997Z","iopub.execute_input":"2022-03-22T09:26:22.753608Z","iopub.status.idle":"2022-03-22T09:26:22.879114Z","shell.execute_reply.started":"2022-03-22T09:26:22.753499Z","shell.execute_reply":"2022-03-22T09:26:22.878117Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_dl, valid_dl = get_data(train_ds, valid_ds, batch_size)\nmodel, opt = get_model(learning_rate)\nfit(epochs, model, loss_func, opt, train_dl, valid_dl)","metadata":{"_uuid":"2d8c10dd-aa10-4d51-82ac-32b7082dba2d","_cell_guid":"fea9ea21-4933-4102-9e8c-d9f04070a1d1","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-03-22T09:26:22.880709Z","iopub.execute_input":"2022-03-22T09:26:22.881519Z","iopub.status.idle":"2022-03-22T09:26:48.674929Z","shell.execute_reply.started":"2022-03-22T09:26:22.881472Z","shell.execute_reply":"2022-03-22T09:26:48.673878Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dev = torch.device(\"cuda\")\nmodel.to(dev)\nx_test_tensor = torch.tensor(test_X.to_numpy()).float()\ntest_start_time = time.time()\ny_test_predicted = model(x_test_tensor.to(dev))\ntest_end_time = time.time()\ntotal_test_time = test_end_time - test_start_time\nprint('GPU : avg Test time %.2f ms'%(total_test_time*1000))\nprint('GPU : Average throughput: %.2f images/second'%(x_test_tensor.shape[0]/total_test_time))\npreds = torch.argmax(y_test_predicted, dim=1)\npreds = preds.cpu()\npreds_np = preds.int().numpy()\nprint(preds_np)","metadata":{"_uuid":"0ba14332-b73a-426d-b860-d706f841c4aa","_cell_guid":"44ee9f74-d644-4eb5-adf3-653ff8417c9d","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-03-22T09:26:48.67664Z","iopub.execute_input":"2022-03-22T09:26:48.677214Z","iopub.status.idle":"2022-03-22T09:26:48.91948Z","shell.execute_reply.started":"2022-03-22T09:26:48.677164Z","shell.execute_reply":"2022-03-22T09:26:48.918448Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Install TensorRT","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!dpkg -l | grep TensorRT","metadata":{"execution":{"iopub.status.busy":"2022-03-22T10:04:20.001646Z","iopub.execute_input":"2022-03-22T10:04:20.001988Z","iopub.status.idle":"2022-03-22T10:04:20.85108Z","shell.execute_reply.started":"2022-03-22T10:04:20.001956Z","shell.execute_reply":"2022-03-22T10:04:20.849931Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import torch_tensorrt","metadata":{"execution":{"iopub.status.busy":"2022-03-22T10:04:34.520904Z","iopub.execute_input":"2022-03-22T10:04:34.521621Z","iopub.status.idle":"2022-03-22T10:04:34.553846Z","shell.execute_reply.started":"2022-03-22T10:04:34.52157Z","shell.execute_reply":"2022-03-22T10:04:34.55239Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"x_test_tensor.shape[0]","metadata":{"execution":{"iopub.status.busy":"2022-03-22T09:28:24.85878Z","iopub.status.idle":"2022-03-22T09:28:24.86002Z","shell.execute_reply.started":"2022-03-22T09:28:24.859668Z","shell.execute_reply":"2022-03-22T09:28:24.859703Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(preds.shape)\nprint(type(preds))\nprint(preds.int().numpy())\npreds.shape[0]","metadata":{"execution":{"iopub.status.busy":"2022-03-22T09:28:24.861702Z","iopub.status.idle":"2022-03-22T09:28:24.862572Z","shell.execute_reply.started":"2022-03-22T09:28:24.862253Z","shell.execute_reply":"2022-03-22T09:28:24.862286Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# np.savetxt('/kaggle/working/submission.csv', preds.int().numpy())\nsubmission_file = open(\"/kaggle/working/submission.csv\", \"w\")\nsubmission_file.write(\"ImageId,Label\\n\")\nfor i in range(preds.shape[0]):\n    submission_file.write(str(i+1)+\",\"+str(preds_np[i])+\"\\n\")\nsubmission_file.close()","metadata":{"execution":{"iopub.status.busy":"2022-03-22T09:28:24.864266Z","iopub.status.idle":"2022-03-22T09:28:24.865136Z","shell.execute_reply.started":"2022-03-22T09:28:24.86482Z","shell.execute_reply":"2022-03-22T09:28:24.864853Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!sudo apt-get install libnvinfer-bin","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!dpkg -l | grep TensorRT","metadata":{"execution":{"iopub.status.busy":"2022-03-22T10:16:24.582644Z","iopub.execute_input":"2022-03-22T10:16:24.583036Z","iopub.status.idle":"2022-03-22T10:16:25.428593Z","shell.execute_reply.started":"2022-03-22T10:16:24.582995Z","shell.execute_reply":"2022-03-22T10:16:25.427417Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"\n\nii  libnvinfer-bin                                               7.0.0-1+cuda10.0                                  amd64        TensorRT binaries\nhi  libnvinfer-dev                                               7.0.0-1+cuda10.0                                  amd64        TensorRT development libraries and headers\nii  libnvinfer-doc                                               7.0.0-1+cuda10.0                                  all          TensorRT documentation\nhi  libnvinfer-plugin-dev                                        7.0.0-1+cuda10.0                                  amd64        TensorRT plugin libraries\nhi  libnvinfer-plugin7                                           7.0.0-1+cuda10.0                                  amd64        TensorRT plugin libraries\nii  libnvinfer-samples                                           7.0.0-1+cuda10.0                                  all          TensorRT samples\nhi  libnvinfer7                                                  7.0.0-1+cuda10.0                                  amd64        TensorRT runtime libraries\nhi  libnvonnxparsers-dev                                         7.0.0-1+cuda10.0                                  amd64        TensorRT ONNX libraries\nhi  libnvonnxparsers7                                            7.0.0-1+cuda10.0                                  amd64        TensorRT ONNX libraries\nhi  libnvparsers-dev                                             7.0.0-1+cuda10.0                                  amd64        TensorRT parsers libraries\nhi  libnvparsers7                                                7.0.0-1+cuda10.0                                  amd64        TensorRT parsers libraries\nhi  python-libnvinfer                                            7.0.0-1+cuda10.0                                  amd64        Python bindings for TensorRT\nhi  python3-libnvinfer                                           7.0.0-1+cuda10.0                                  amd64        Python 3 bindings for TensorRT\nii  tensorrt                                                     7.0.0.11-1+cuda10.0                               amd64        Meta package of TensorRT\n\n","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import torch_tensorrt","metadata":{"execution":{"iopub.status.busy":"2022-03-22T10:16:50.320546Z","iopub.execute_input":"2022-03-22T10:16:50.320873Z","iopub.status.idle":"2022-03-22T10:16:50.353091Z","shell.execute_reply.started":"2022-03-22T10:16:50.320833Z","shell.execute_reply":"2022-03-22T10:16:50.351786Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}