Skip to content

multi-thread context torch.inverse #5696

@wyli

Description

@wyli
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/localhome/Projects/monailabel/monailabel/interfaces/utils/app.py", line 132, in <module>
    run_main()
  File "/localhome/Projects/monailabel/monailabel/interfaces/utils/app.py", line 121, in run_main
    result = a.batch_infer(request)
  File "/localhome/Projects/monailabel/monailabel/interfaces/app.py", line 338, in batch_infer
    return self._batch_infer(request, datastore if datastore else self.datastore(), self.infer)
  File "/localhome/Projects/monailabel/monailabel/interfaces/tasks/batch_infer.py", line 100, in __call__
    res = future.result()
  File "/usr/lib/python3.10/concurrent/futures/_base.py", line 458, in result
    return self.__get_result()
  File "/usr/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
    raise self._exception
  File "/usr/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/localhome/Projects/monailabel/monailabel/interfaces/tasks/batch_infer.py", line 124, in run_infer_task
    r = infer(req, datastore)
  File "/localhome/Projects/monailabel/monailabel/interfaces/app.py", line 300, in infer
    result_file_name, result_json = task(request)
  File "/localhome/Projects/monailabel/monailabel/tasks/infer/basic_infer.py", line 297, in __call__
    data = self.run_pre_transforms(data, pre_transforms)
  File "/localhome/Projects/monailabel/monailabel/tasks/infer/basic_infer.py", line 388, in run_pre_transforms
    return run_transforms(data, transforms, log_prefix="PRE", use_compose=False)
  File "/localhome/Projects/monailabel/monailabel/interfaces/utils/transform.py", line 106, in run_transforms
    data = t(data)
  File "/localhome/Projects/MONAI/monai/transforms/spatial/dictionary.py", line 416, in __call__
    d[key] = self.spacing_transform(
  File "/localhome/Projects/MONAI/monai/utils/deprecate_utils.py", line 221, in _wrapper
    return func(*args, **kwargs)
  File "/localhome/Projects/MONAI/monai/transforms/spatial/array.py", line 606, in __call__
    data_array = self.sp_resample(
  File "/localhome/Projects/MONAI/monai/utils/deprecate_utils.py", line 221, in _wrapper
    return func(*args, **kwargs)
  File "/localhome/Projects/MONAI/monai/transforms/spatial/array.py", line 315, in __call__
    img = affine_xform(img.unsqueeze(0), theta=xform, spatial_size=spatial_size).squeeze(0)
  File "/localhome/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1190, in _call_impl
    return forward_call(*input, **kwargs)
  File "/localhome/Projects/MONAI/monai/networks/layers/spatial_transforms.py", line 556, in forward
    theta = to_norm_affine(
  File "/localhome/Projects/MONAI/monai/networks/utils.py", line 279, in to_norm_affine
    return src_xform @ affine @ torch.inverse(dst_xform)
RuntimeError: lazy wrapper should be called at most once

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions