Compute_shooting() ERROR

23 views
Skip to first unread message

María Arrese Zubizarreta

unread,
Apr 3, 2025, 9:54:44 AM4/3/25
to Deformetrica
Hi all, 

I'm using deformetrica in order to shoot some PLS analysis in some 3D shapes. Nevertheless, I having some trouble while calling to compute_shooting function from deformetrica. This is the error that I have everytime I run my code. Does someone know how can I fix it? 
Thank you so much!!

ERROR:

---------------------------------------------------------------------------

ImportError Traceback (most recent call last)

Cell In[6], line 26

22 deformetrica = Deformetrica(output_dir=outputfolder, verbosity='INFO')

24 template_specifications = {'aorta': {'deformable_object_type': 'SurfaceMesh', 'kernel_type': 'keops', 'kernel_width': 10.0, 'filename': '/home/maria/Documentos/Maria/PA -- Maria/Maria_EmiliePC/SSM/shapemodels/Run7/test2/output/DeterministicAtlas__EstimatedParameters__Template_pa.vtk','noise_std': 0.1}}

---> 26 model = deformetrica.compute_shooting(template_specifications,model_options={'number_of_timepoints': 11, 'concentration_of_timepoints': 1, 'initial_control_points': '/home/maria/Documentos/Maria/PA -- Maria/Maria_EmiliePC/SSM/shapemodels/Run7/test2/output/DeterministicAtlas__EstimatedParameters__ControlPoints.txt', 'initial_momenta': momenta, 'deformation_kernel_type': 'keops', 'deformation_kernel_width': 30.0, 'tmin': -1, 'tmax': 1, 't0': 0.0})

28 l = [f for f in os.listdir(outputfolder) if f.endswith('.vtk')]

29 for filename in l:


File ~/Documentos/shooting/deformetrica.py:463, in Deformetrica.compute_shooting(self, template_specifications, model_options)

460 logger.debug("dtype=" + default.dtype)

462 # Launch.

--> 463 compute_shooting(template_specifications, output_dir=self.output_dir, **model_options)


File ~/Documentos/shooting/launch/compute_shooting.py:109, in compute_shooting(template_specifications, dimension, tensor_scalar_type, tensor_integer_type, deformation_kernel_type, deformation_kernel_width, deformation_kernel_device, shoot_kernel_type, initial_control_points, initial_momenta, concentration_of_time_points, t0, tmin, tmax, dense_mode, number_of_time_points, use_rk2_for_shoot, use_rk2_for_flow, gpu_mode, output_dir, **kwargs)

107 if len(momenta.shape) == 2:

108 geodesic.set_momenta_t0(momenta_torch)

--> 109 geodesic.update()

110 names = [elt for elt in t_name]

111 geodesic.write('Shooting', names, t_name_extension, template, template_data, output_dir,

112 write_adjoint_parameters=True)


File ~/Documentos/shooting/core/model_tools/deformations/geodesic.py:230, in Geodesic.update(self)

228 if self.backward_exponential.number_of_time_points > 1:

229 self.backward_exponential.move_data_to_(device=device)

--> 230 self.backward_exponential.update()

232 # Forward exponential --------------------------------------------------------------------------------------

233 length = self.tmax - self.t0


File ~/Documentos/shooting/core/model_tools/deformations/exponential.py:173, in Exponential.update(self)

171 self.cometric_matrices.clear()

172 # self.cholesky_matrices.clear()

--> 173 self.shoot()

174 if self.initial_template_points is not None:

175 self.flow()


File ~/Documentos/shooting/core/model_tools/deformations/exponential.py:210, in Exponential.shoot(self)

208 else:

209 for i in range(self.number_of_time_points - 1):

--> 210 new_cp, new_mom = self._euler_step(self.shoot_kernel, self.control_points_t[i], self.momenta_t[i], dt)

211 self.control_points_t.append(new_cp)

212 self.momenta_t.append(new_mom)


File ~/Documentos/shooting/core/model_tools/deformations/exponential.py:483, in Exponential._euler_step(kernel, cp, mom, h)

478 """

479 simple euler step of length h, with cp and mom. It always returns mom.

480 """

481 assert cp.device == mom.device, 'tensors must be on the same device, cp.device=' + str(

482 cp.device) + ', mom.device=' + str(mom.device)

--> 483 return cp + h * kernel.convolve(cp, cp, mom), \

484 mom - h * kernel.convolve_gradient(mom, cp)


File ~/Documentos/shooting/support/kernels/keops_kernel.py:82, in KeopsKernel.convolve(self, x, y, p, mode)

79 gamma = self.gamma.to(x.device, dtype=x.dtype)

81 device_id = x.device.index if x.device.index is not None else -1

---> 82 res = self.gaussian_convolve[d - 2](gamma, x.contiguous(), y.contiguous(), p.contiguous(), device_id=device_id)

83 return res.cpu() if self.gpu_mode is GpuMode.KERNEL else res

85 elif mode == 'pointcloud':


File ~/anaconda3/envs/deformetrica_env/lib/python3.8/site-packages/pykeops/torch/generic/generic_red.py:395, in Genred.__call__(self, backend, device_id, ranges, *args)

392 if self.dtype in ('float16','half'):

393 args, ranges, tag_dummy, N = preprocess_half2(args, self.aliases, self.axis, ranges, nx, ny)

--> 395 out = GenredAutograd.apply(self.formula, self.aliases, backend, self.dtype,

396 device_id, ranges, self.accuracy_flags, *args)

398 if self.dtype in ('float16','half'):

399 out = postprocess_half2(out, tag_dummy, self.reduction_op, N)


File ~/anaconda3/envs/deformetrica_env/lib/python3.8/site-packages/pykeops/torch/generic/generic_red.py:22, in GenredAutograd.forward(ctx, formula, aliases, backend, dtype, device_id, ranges, accuracy_flags, *args)

17 @staticmethod

18 def forward(ctx, formula, aliases, backend, dtype, device_id, ranges, accuracy_flags, *args):

20 optional_flags = include_dirs + accuracy_flags

---> 22 myconv = LoadKeOps(formula, aliases, dtype, 'torch', optional_flags).import_module()

24 # Context variables: save everything to compute the gradient:

25 ctx.formula = formula


File ~/anaconda3/envs/deformetrica_env/lib/python3.8/site-packages/pykeops/common/keops_io.py:70, in LoadKeOps.import_module(self)

69 def import_module(self):

---> 70 return importlib.import_module(self.dll_name)


File ~/anaconda3/envs/deformetrica_env/lib/python3.8/importlib/__init__.py:127, in import_module(name, package)

125 break

126 level += 1

--> 127 return _bootstrap._gcd_import(name[level:], package, level)


File <frozen importlib._bootstrap>:1014, in _gcd_import(name, package, level)


File <frozen importlib._bootstrap>:991, in _find_and_load(name, import_)


File <frozen importlib._bootstrap>:975, in _find_and_load_unlocked(name, import_)


File <frozen importlib._bootstrap>:657, in _load_unlocked(spec)


File <frozen importlib._bootstrap>:556, in module_from_spec(spec)


File <frozen importlib._bootstrap_external>:1166, in create_module(self, spec)


File <frozen importlib._bootstrap>:219, in _call_with_frames_removed(f, *args, **kwds)


ImportError: /home/maria/anaconda3/envs/deformetrica_env/bin/../lib/libstdc++.so.6: version `GLIBCXX_3.4.32' not found (required by /home/maria/.cache/pykeops-1.4.1-cpython-38/libKeOpstorch6140102042.cpython-38-x86_64-linux-gnu.so)


Reply all
Reply to author
Forward
0 new messages