Skip to content

runtime error: tensor size issue #1

Description

@bradmoffat

When i execute the following

!pyhysco b0_AP.nii.gz b0_PA.nii.gz 2

I get

Traceback (most recent call last):
File "/opt/conda/bin/pyhysco", line 8, in
sys.exit(main())
^^^^^^
File "/opt/conda/lib/python3.12/site-packages/scripts/pyhysco.py", line 41, in main
B0 = loss_func.initialize(blur_result=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.12/site-packages/EPI_MRI/EPIMRIDistortionCorrection.py", line 319, in initialize
return self.initialization.eval(self.dataObj, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.12/site-packages/EPI_MRI/InitializationMethods.py", line 61, in eval
return self.blur(self.init_OT(data, *args, **kwargs).reshape(list(m_plus(data.m))), data.omega, data.m)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.12/site-packages/EPI_MRI/InitializationMethods.py", line 158, in blur
K = FFT3D(L, m)
^^^^^^^^^^^
File "/opt/conda/lib/python3.12/site-packages/EPI_MRI/LinearOperators.py", line 153, in init
self.eig = self.compute_eigs()
^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.12/site-packages/EPI_MRI/LinearOperators.py", line 173, in compute_eigs
Bp[j0:j0 + k[0], j1:j1 + k[1], j2 + 1:j2 + k[2] + 1] = self.kernel
~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: The expanded size of the tensor (1) must match the existing size (3) at non-singleton dimension 0. Target sizes: [1, 3, 3]. Tensor sizes: [3, 3, 3]

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions