morinop commited on
Commit
7b7b81a
1 Parent(s): 079f211

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -26,6 +26,7 @@ def update_bn(image):
26
  cursor_im = 0
27
  image = T.Resize((40,40))(image)
28
  image = image.reshape(-1)
 
29
  for m in model.modules():
30
  if(type(m) is nn.BatchNorm2d):
31
  if(cursor_im < image.shape[0]):
@@ -33,6 +34,7 @@ def update_bn(image):
33
  if(cursor_im+M < image.shape[0]):
34
  m.running_mean.data = image[cursor_im:cursor_im+M]
35
  cursor_im += M # next
 
36
  else:
37
  m.running_mean.data[:image.shape[0]-cursor_im] = image[cursor_im:]
38
  break # finish
 
26
  cursor_im = 0
27
  image = T.Resize((40,40))(image)
28
  image = image.reshape(-1)
29
+ print(image.shape)
30
  for m in model.modules():
31
  if(type(m) is nn.BatchNorm2d):
32
  if(cursor_im < image.shape[0]):
 
34
  if(cursor_im+M < image.shape[0]):
35
  m.running_mean.data = image[cursor_im:cursor_im+M]
36
  cursor_im += M # next
37
+ print(cursor_im,':',cursor_im+M)
38
  else:
39
  m.running_mean.data[:image.shape[0]-cursor_im] = image[cursor_im:]
40
  break # finish