Skip to content

Commit 1ce897a

Browse files
committed
fix deprecation: torch.meshgrid
1 parent d2700c3 commit 1ce897a

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Fork of [deepcam-cn/yolov5-face](https://github.com/deepcam-cn/yolov5-face)
22

33
* Added [requirements.txt](requirements.txt) file.
4+
* Fixed deprecations:
5+
* UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument.
46

57
# Installation
68

models/yolo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def forward(self, x):
111111

112112
@staticmethod
113113
def _make_grid(nx=20, ny=20):
114-
yv, xv = torch.meshgrid([torch.arange(ny), torch.arange(nx)])
114+
yv, xv = torch.meshgrid([torch.arange(ny), torch.arange(nx)], indexing='ij')
115115
return torch.stack((xv, yv), 2).view((1, 1, ny, nx, 2)).float()
116116

117117
def _make_grid_new(self,nx=20, ny=20,i=0):

0 commit comments

Comments
 (0)