Kohulan / DECIMER-Image-Segmentation

Chemical structure detection and segmentation tool for Journal articles.
https://decimer.ai
MIT License
81 stars 30 forks source link

Error with expanded mask function #70

Closed Iagea closed 1 year ago

Iagea commented 1 year ago

Hi,

I was getting an error on line 451 from decimer_segmentation/complete_structure.py:

arrays to stack must be passed as a "sequence" type such as list or tuple.

It's fixed changing the line 451 to mask_array = np.stack(list(expanded_split_mask_arrays), -1)

Best, Isa.

Kohulan commented 1 year ago

Hi @Iagea ,

Why did the error occur in the first place and which document caused the error?

Iagea commented 1 year ago

Hi @Kohulan,

any PDF document I've tried (4) when running directly the script segment_structures_in_document.py as well as when running directly the example Notebook with the example test_page.pdf when expand = True for the segment_chemical_structures function: segments = segment_chemical_structures(np.array(pages[0]), expand=True, visualization=True)

PS: Tensorflow version 2.11.0.

Kohulan commented 1 year ago

Could you reproduce the same error using Tensorflow 2.10.0 or 2.12.0?

Iagea commented 1 year ago

Ok, I just tried with two different environments and no, Tensorflow 2.10.0 and 2.12.0 also works fine. Must be a Tensorflow 2.11.1 problem.

Forget about it then

Kohulan commented 1 year ago

Thanks for confirming this issue. I would for now stick with TF 2.10.