You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
During the process of adding back - propagation gradients, I found that the output of the model in the BaseCAM function, self.outputs, has a size of (25200, 85). When continuing with the gradient calculation, how should I select the output tensors to calculate the loss and complete the back - propagation?
if self.uses_gradients:
self.model.zero_grad()
# for param in self.model.parameters(): # 设置requires_grad=True
# if not param.requires_grad:
# param.requires_grad = True
for name, param in self.model.named_parameters():
print(f"Parameter name: {name}, requires_grad: {param.requires_grad}")
loss = sum([target(output) for target, output in zip(targets, outputs)])
loss.backward(retain_graph=True)
if 'hpu' in str(self.device):
self.__htcore.mark_step()
outputs, has a size of (25200, 85).
The text was updated successfully, but these errors were encountered:
During the process of adding back - propagation gradients, I found that the output of the model in the BaseCAM function, self.outputs, has a size of (25200, 85). When continuing with the gradient calculation, how should I select the output tensors to calculate the loss and complete the back - propagation?
outputs, has a size of (25200, 85).
The text was updated successfully, but these errors were encountered: