CERN / TIGRE

TIGRE: Tomographic Iterative GPU-based Reconstruction Toolbox
BSD 3-Clause "New" or "Revised" License
573 stars 188 forks source link

d08_Algorithms03.py stops #325

Closed tsadakane closed 3 years ago

tsadakane commented 3 years ago

Expected Behavior

d08_Algorithms03.py stops

Actual Behavior

(dev38) D:\ws\20210907_TIGRE\Python>python demos\d08_Algorithms03.py
CGLS Algorithm in progress.
Estimated time until completion : 00:00:12
re-initilization of CGLS called at iteration:21
re-initilization of CGLS called at iteration:23
re-initilization of CGLS called at iteration:26
re-initilization of CGLS called at iteration:29
re-initilization of CGLS called at iteration:47
Average time taken for each iteration for CGLS:0.024714343333333482(s)
Traceback (most recent call last):
  File "demos\d08_Algorithms03.py", line 72, in <module>
    imgCGLS, errL2CGLS = algs.cgls(noise_projections, geo, angles, 60, computel2=True)
  File "d:\ws\20210907_TIGRE\python\tigre\algorithms\iterative_recon_alg.py", line 466, in iterativereconalg
    return alg.getres(), alg.geterrors()
  File "d:\ws\20210907_TIGRE\python\tigre\algorithms\iterative_recon_alg.py", line 415, in geterrors
    return np.concatenate((self.l2l, self.lq), axis=0)
  File "<__array_function__ internals>", line 5, in concatenate
ValueError: all the input arrays must have same number of dimensions, but the array at index 0 has 
2 dimension(s) and the array at index 1 has 1 dimension(s)

Adding the following lines just above the line stopped

            print(self.l2l.shape)
            print(self.lq.shape)

resulted in

(1, 10)
(0,)

Code to reproduce the problem (If applicable)

d08_Algorithms03.py

Specifications

AnderBiguri commented 3 years ago

perhaps related to #309

tsadakane commented 3 years ago

I think the two line modified at #309 https://github.com/CERN/TIGRE/blob/a67bd964e7b0a5d70dc405ccf8fc24e3bfd86dea/Python/tigre/algorithms/iterative_recon_alg.py#L212-L213

can be removed, because self.lq and self.l2l are initialized just above the two lines as numpy ndarray's . d08_Algorithms03.py ran without error when they are removed.