Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trackpy.batch only works with processes = 1 #771

Open
ggomes-altos opened this issue Aug 8, 2024 · 2 comments
Open

trackpy.batch only works with processes = 1 #771

ggomes-altos opened this issue Aug 8, 2024 · 2 comments

Comments

@ggomes-altos
Copy link

Python 3.12.4
trackpy 0.6.4

The following runs without error:
f = tp.batch(frames, 11, invert=False, minmass=500, processes=1)

whereas processes = 2 gives a long error message ultimately ending in TiffFileError: corrupted tag list at offset 254920375

and processes = 'auto' gives a warning ( ValueError: need at most 63 handles, got a sequence of length 66 ) which disappears and is replaced with the Frame number 1 and number of features, but the computation never ends.

Happy to include full error messages if necessary.

@nkeim
Copy link
Contributor

nkeim commented Aug 11, 2024 via email

@ggomes-altos
Copy link
Author

Hi sorry for the delayed response.

I have pims 0.7
libtiff 4.6.0
tifffile 2023.4.12

I think tiffffile is doing the tiff reading since in the lowest level of the error message it seems to be using the tifffile package:


ValueError Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_18640\387384096.py in ?()
----> 1 f = tp.batch(frames, 11, invert=False, minmass=500, processes=2);

A_path\Lib\site-packages\trackpy\feature.py in ?(frames, diameter, output, meta, processes, after_locate, **kwargs)
577 output.put(features)
578 finally:
579 if pool:
580 # Ensure correct termination of Pool
--> 581 pool.terminate()
582
583 if output is None:
584 if len(all_features) > 0:

A_path\Lib\site-packages\slicerator_init_.py in ?(self, i)
183 def getitem(self, i):
184 """Getitem supports repeated slicing via Slicerator objects."""
185 indices, new_length = key_to_indices(i, len(self))
186 if new_length is None:
--> 187 return self._get(indices)
188 else:
189 return cls(self, indices, new_length, propagate_attrs)

A_path\Lib\site-packages\pims\base_frames.py in ?(self, key)
97 def getitem(self, key):
98 """getitem is handled by Slicerator. In all pims readers, the data
99 returning function is get_frame."""
--> 100 return self.get_frame(key)

A_path\Lib\site-packages\pims\tiff_stack.py in ?(self, j)
129 def get_frame(self, j):
130 t = self._tiff[j]
--> 131 data = t.asarray()
132 return Frame(data, frame_no=j, metadata=self._read_metadata(t))

A_path\Lib\site-packages\tifffile\tifffile.py in ?(self, out, squeeze, lock, maxworkers)
8835 f'{self!r} reading array from closed file', UserWarning
8836 )
8837 fh.open()
8838 fh.seek(self.dataoffsets[0])
-> 8839 result = fh.read_array(
8840 keyframe.parent.byteorder + keyframe._dtype.char,
8841 product(keyframe.shaped),
8842 out=out,

A_apth\Lib\site-packages\tifffile\tifffile.py in ?(self, dtype, count, offset, out)
14214 )
14215 n = nbytes
14216
14217 if n != nbytes:

14218 raise ValueError(f'failed to read {nbytes} bytes, got {n}')
14219
14220 if not result.dtype.isnative:
14221 if not dtype.isnative:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants