diff --git a/README.md b/README.md
index ea86f3ce..0fc7c330 100644
--- a/README.md
+++ b/README.md
@@ -136,7 +136,7 @@ On the `ONNXRuntime` front you can use the [C++ example](deployment/onnxruntime)
Now, `yolort` can draw the model graph directly, checkout our [model-graph-visualization](notebooks/model-graph-visualization.ipynb) notebook to see how to use and visualize the model graph.
-
+
## :mortar_board: Acknowledgement
diff --git a/notebooks/assets/yolov5.detail.svg b/notebooks/assets/yolov5.detail.svg
deleted file mode 100644
index e78744d8..00000000
--- a/notebooks/assets/yolov5.detail.svg
+++ /dev/null
@@ -1,234 +0,0 @@
-
-
-
-
-
diff --git a/notebooks/assets/yolov5_graph_visualize.png b/notebooks/assets/yolov5_graph_visualize.png
new file mode 100644
index 00000000..64d228f6
Binary files /dev/null and b/notebooks/assets/yolov5_graph_visualize.png differ
diff --git a/notebooks/assets/yolov5_graph_visualize.svg b/notebooks/assets/yolov5_graph_visualize.svg
new file mode 100644
index 00000000..8a5ed075
--- /dev/null
+++ b/notebooks/assets/yolov5_graph_visualize.svg
@@ -0,0 +1,245 @@
+
+
+
+
+
diff --git a/notebooks/model-graph-visualization.ipynb b/notebooks/model-graph-visualization.ipynb
index d2eb6a40..dc99e0ec 100644
--- a/notebooks/model-graph-visualization.ipynb
+++ b/notebooks/model-graph-visualization.ipynb
@@ -45,20 +45,28 @@
"name": "stderr",
"output_type": "stream",
"text": [
- "/usr/local/lib/python3.6/dist-packages/torch/tensor.py:593: RuntimeWarning: Iterating over a tensor might cause the trace to be incorrect. Passing a tensor of different shape won't change the number of iterations executed (and might lead to errors or silently give incorrect results).\n",
- " 'incorrect results).', category=RuntimeWarning)\n",
- "/data/wangzq/yolov5-rt-stack/yolort/models/anchor_utils.py:31: TracerWarning: torch.as_tensor results are registered as constants in the trace. You can safely ignore this warning if you use this function to create tensors out of constant variables that would be the same every time you call this function. In any other case, this might cause the trace to be incorrect.\n",
+ "/opt/homebrew/lib/python3.9/site-packages/pytorch_lightning/core/lightning.py:168: LightningDeprecationWarning: The `LightningModule.datamodule` property is deprecated in v1.3 and will be removed in v1.5. Access the datamodule through using `self.trainer.datamodule` instead.\n",
+ " rank_zero_deprecation(\n",
+ "/Users/zhiqiang/Coding/yolov5-rt-stack/yolort/models/yolo_module.py:97: TracerWarning: Iterating over a tensor might cause the trace to be incorrect. Passing a tensor of different shape won't change the number of iterations executed (and might lead to errors or silently give incorrect results).\n",
+ " for img in inputs:\n",
+ "/Users/zhiqiang/Coding/yolov5-rt-stack/yolort/models/transform.py:79: TracerWarning: Iterating over a tensor might cause the trace to be incorrect. Passing a tensor of different shape won't change the number of iterations executed (and might lead to errors or silently give incorrect results).\n",
+ " images = [img for img in images]\n",
+ "/opt/homebrew/lib/python3.9/site-packages/torch/nn/functional.py:718: UserWarning: Named tensors and all their associated APIs are an experimental feature and subject to change. Please do not use them for anything important until they are released as stable. (Triggered internally at ../c10/core/TensorImpl.h:1156.)\n",
+ " return torch.max_pool2d(input, kernel_size, stride, padding, dilation, ceil_mode)\n",
+ "/Users/zhiqiang/Coding/yolov5-rt-stack/yolort/models/anchor_utils.py:31: TracerWarning: torch.as_tensor results are registered as constants in the trace. You can safely ignore this warning if you use this function to create tensors out of constant variables that would be the same every time you call this function. In any other case, this might cause the trace to be incorrect.\n",
" stride = torch.as_tensor([stride], dtype=dtype, device=device)\n",
- "/data/wangzq/yolov5-rt-stack/yolort/models/anchor_utils.py:50: TracerWarning: torch.as_tensor results are registered as constants in the trace. You can safely ignore this warning if you use this function to create tensors out of constant variables that would be the same every time you call this function. In any other case, this might cause the trace to be incorrect.\n",
+ "/Users/zhiqiang/Coding/yolov5-rt-stack/yolort/models/anchor_utils.py:50: TracerWarning: torch.as_tensor results are registered as constants in the trace. You can safely ignore this warning if you use this function to create tensors out of constant variables that would be the same every time you call this function. In any other case, this might cause the trace to be incorrect.\n",
" anchor_grid = torch.as_tensor(anchor_grid, dtype=dtype, device=device)\n",
- "/data/wangzq/yolov5-rt-stack/yolort/models/anchor_utils.py:79: TracerWarning: torch.tensor results are registered as constants in the trace. You can safely ignore this warning if you use this function to create tensors out of constant variables that would be the same every time you call this function. In any other case, this might cause the trace to be incorrect.\n",
+ "/Users/zhiqiang/Coding/yolov5-rt-stack/yolort/models/anchor_utils.py:79: TracerWarning: torch.tensor results are registered as constants in the trace. You can safely ignore this warning if you use this function to create tensors out of constant variables that would be the same every time you call this function. In any other case, this might cause the trace to be incorrect.\n",
" shifts = shifts - torch.tensor(0.5, dtype=shifts.dtype, device=device)\n",
- "/data/wangzq/yolov5-rt-stack/yolort/models/box_head.py:332: TracerWarning: Converting a tensor to a Python index might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs!\n",
- " for idx in range(batch_size): # image idx, image inference\n",
- "/data/wangzq/yolov5-rt-stack/yolort/models/transform.py:298: TracerWarning: torch.tensor results are registered as constants in the trace. You can safely ignore this warning if you use this function to create tensors out of constant variables that would be the same every time you call this function. In any other case, this might cause the trace to be incorrect.\n",
- " for s, s_orig in zip(new_size, original_size)\n",
- "/data/wangzq/yolov5-rt-stack/yolort/models/transform.py:298: UserWarning: To copy construct from a tensor, it is recommended to use sourceTensor.clone().detach() or sourceTensor.clone().detach().requires_grad_(True), rather than torch.tensor(sourceTensor).\n",
- " for s, s_orig in zip(new_size, original_size)\n"
+ "/Users/zhiqiang/Coding/yolov5-rt-stack/yolort/models/transform.py:312: TracerWarning: torch.tensor results are registered as constants in the trace. You can safely ignore this warning if you use this function to create tensors out of constant variables that would be the same every time you call this function. In any other case, this might cause the trace to be incorrect.\n",
+ " torch.tensor(s, dtype=torch.float32, device=boxes.device)\n",
+ "/Users/zhiqiang/Coding/yolov5-rt-stack/yolort/models/transform.py:312: UserWarning: To copy construct from a tensor, it is recommended to use sourceTensor.clone().detach() or sourceTensor.clone().detach().requires_grad_(True), rather than torch.tensor(sourceTensor).\n",
+ " torch.tensor(s, dtype=torch.float32, device=boxes.device)\n",
+ "/Users/zhiqiang/Coding/yolov5-rt-stack/yolort/models/transform.py:313: TracerWarning: torch.tensor results are registered as constants in the trace. You can safely ignore this warning if you use this function to create tensors out of constant variables that would be the same every time you call this function. In any other case, this might cause the trace to be incorrect.\n",
+ " / torch.tensor(s_orig, dtype=torch.float32, device=boxes.device)\n",
+ "/Users/zhiqiang/Coding/yolov5-rt-stack/yolort/models/transform.py:313: UserWarning: To copy construct from a tensor, it is recommended to use sourceTensor.clone().detach() or sourceTensor.clone().detach().requires_grad_(True), rather than torch.tensor(sourceTensor).\n",
+ " / torch.tensor(s_orig, dtype=torch.float32, device=boxes.device)\n"
]
}
],
@@ -77,8 +85,8 @@
"output_type": "stream",
"text": [
"def forward(self,\n",
- " images: Tensor) -> Tuple[Tensor, Tensor, Tensor]:\n",
- " _0, _1, _2, = (self.model).forward(images, )\n",
+ " x: Tensor) -> Tuple[Tensor, Tensor, Tensor]:\n",
+ " _0, _1, _2, = (self.model).forward(x, )\n",
" return (_0, _1, _2)\n",
"\n"
]
@@ -126,252 +134,251 @@
"\n",
"\n",
- "\n",
- "\n",
- "