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
model = IntraNoAR()
model_path = '<path to DCVC repo>/DCVC-DC/checkpoints/cvpr2023_image_psnr.pth.tar'
state_dict = get_state_dict(model_path)
model.load_state_dict(state_dict)
model.eval()
input_shape = (1, 3, 1088, 1920)
x = torch.ones(input_shape)
traced_model = torch.jit.trace(model, x)
File "<path to lib>/lib/python3.9/site-packages/torch/jit/_trace.py", line 759, in trace
return trace_module(
File "<path to lib>/python3.9/site-packages/torch/jit/_trace.py", line 976, in trace_module
module._c._create_method_from_trace(
File "<path to lib>/python3.9/site-packages/torch/nn/modules/module.py", line 1178, in _slow_forward
result = self.forward(*input, **kwargs)
File "<path to dcvc>/DCVC-DC/src/models/image_model.py", line 115, in forward
curr_q_enc, curr_q_dec = self.get_q_for_inference(q_in_ckpt, q_index)
File "<path to dcvc>/DCVC-DC/src/models/image_model.py", line 109, in get_q_for_inference
curr_q_enc = self.get_curr_q(q_scale_enc, self.q_basic_enc, q_index=q_index)
File "<path to dcvc>/DCVC-DC/src/models/common_model.py", line 37, in get_curr_q
return q_basic * q_scale
File "<path to lib>/lib/python3.9/site-packages/torch/_tensor.py", line 955, in __array__
return self.numpy()
RuntimeError: Can't call numpy() on Tensor that requires grad. Use tensor.detach().numpy() instead.
The text was updated successfully, but these errors were encountered:
Repro script
The text was updated successfully, but these errors were encountered: