source code
def anim(i):
# update SMBLD
cur_beta_idx, cur_step = i // num_steps, i % num_steps
val = shape_range[cur_step]
mesh.multi_betas[0, cur_beta_idx] = val # Update betas
fig.suptitle(f"{name.title()}\nS{cur_beta_idx} : {val:+.2f}", fontsize=50) # update text
return dict(mesh=mesh.get_meshes(), equalize=False)
Modified code
Add with torch.no_grad():
will be OK!
def anim(i):
# update SMBLD
cur_beta_idx, cur_step = i // num_steps, i % num_steps
val = shape_range[cur_step]
#print("\ncur_beta_idx:",cur_beta_idx,mesh.multi_betas[0, cur_beta_idx])
with torch.no_grad():###添加
mesh.multi_betas[0, cur_beta_idx] = val # Update betas
fig.suptitle(f"{name.title()}\nS{cur_beta_idx} : {val:+.2f}", fontsize=50) # update text
return dict(mesh=mesh.get_meshes(), equalize=False)
Read More:
- [Solved] RuntimeError: a view of a leaf Variable that requires grad is being used in an in-place
- Autograd error in Python: runtimeerror: grad can be implicitly created only for scalar outputs
- [Solved] Pytorch Tensor to numpy error: RuntimeError: Can‘t call numpy() on Tensor that requires grad.报错
- pytorch DDP Accelerate Error: [W reducer.cpp:362] Warning: Grad strides do not match bucket view strides.
- [Solved] RuntimeError: No application found. Either work inside a view function or push an application contex
- Here is the difference and connection of Torch. View (), Transpose (), and Permute ()
- [Solved] Using summary to View network parameters Error: RuntimeError: Input type (torch.cuda.FloatTensor)
- RuntimeError: Invalid DISPLAY variable [How to Solve]
- [Solved] RuntimeError: cuda runtime error (801) : operation not supported at
- [Solved] error: when using the property decorator in Python, an error occurs: typeerror: descriptor ‘setter’ requires a ‘property’ object but
- [Solved] RuntimeError: Error(s) in loading state_dict for BertForTokenClassification
- [Solved] Pytorch Error: RuntimeError: Error(s) in loading state_dict for Network: size mismatch
- [Solved] RuntimeError: function ALSQPlusBackward returned a gradient different than None at position 3, but t
- [Solved] RuntimeError (note: full exception trace is shown but execution is paused at: <module>)
- [Solved] RuntimeError: Error(s) in loading state_dict for Net:
- [Solved] pytorch loss.backward() Error: RuntimeError: Function AddBackward0 returned an invalid gradient at index 1…
- [Solved] RuntimeError: Numpy is not available (Associated Torch or Tensorflow)
- [Solved] RuntimeError: one of the variables needed for gradient computation has been modified by an inplace
- [Solved] RuntimeError: ProcessGroupNCCL is only supported with GPUs, no GPUs found
- OSError: [WinError 1455] The page file is too small to complete the operation. Error loading…