Silent bug in Topaz Train when processed micrograph path not given

Hi,

I think I found a small bug in Topaz Train.

  • Job: Topaz Train
  • Input: Denoised micrographs + Particles selected
    Cryosparc Current version: v3.3.2+220824
    Topaz TOPAZ 0.2.3 - works fine otherwise

If the “Absolute path of directory containing preprocessed directory” is not set, no error is raised (no red writing), but a traceback shows up where each thread appears to look for denoised micrographs in the root folder of the project, and then complains with a IsADirectoryError .
The training procedure completes normally (from Inverting negative staining… onwards)
I think that either some error should be raised, or the process should get the denoised micrographs path from the connected input.
If the path to the denoised micrographs is provided (e.g. PXX/JX/denoised_micrographs, no issue is observed.

Traceback excerpt:
[multiple threads fail identically - I am showing only one traceback]

[CPU: 232.3 MB]  Preprocessing over 8 processes...

[CPU: 232.8 MB]  multiprocessing.pool.RemoteTraceback:

[CPU: 232.8 MB]  """

[CPU: 232.8 MB]  Traceback (most recent call last):

[CPU: 232.8 MB]  multiprocessing.pool.RemoteTraceback:
[CPU: 232.8 MB]  File "/soft/anaconda/envs/topaz/lib/python3.6/multiprocessing/pool.py", line 119, in worker
[CPU: 232.8 MB]  """
[CPU: 232.8 MB]  result = (True, func(*args, **kwds))
[CPU: 232.8 MB]  Traceback (most recent call last):
[CPU: 232.8 MB]  File "/soft/anaconda/envs/topaz/lib/python3.6/site-packages/topaz/commands/normalize.py", line 60, in __call__
[CPU: 232.8 MB]  File "/soft/anaconda/envs/topaz/lib/python3.6/multiprocessing/pool.py", line 119, in worker
[CPU: 232.8 MB]  x = np.array(load_image(path), copy=False).astype(np.float32)
[CPU: 232.8 MB]  multiprocessing.pool.RemoteTraceback:
[CPU: 232.8 MB]  result = (True, func(*args, **kwds))
[CPU: 232.8 MB]  File "/soft/anaconda/envs/topaz/lib/python3.6/site-packages/topaz/utils/data/loader.py", line 105, in load_image
[CPU: 232.8 MB]  """
[CPU: 232.8 MB]  image = load_pil(path, standardize=standardize)
[CPU: 232.8 MB]  File "/soft/anaconda/envs/topaz/lib/python3.6/site-packages/topaz/commands/normalize.py", line 60, in __call__
[CPU: 232.8 MB]  File "/soft/anaconda/envs/topaz/lib/python3.6/site-packages/topaz/utils/data/loader.py", line 97, in load_pil
[CPU: 232.8 MB]  x = np.array(load_image(path), copy=False).astype(np.float32)
[CPU: 232.8 MB]  Traceback (most recent call last):
[CPU: 232.8 MB]  return load_tiff(path, standardize=standardize)
[CPU: 232.8 MB]  File "/soft/anaconda/envs/topaz/lib/python3.6/site-packages/topaz/utils/data/loader.py", line 105, in load_image
[CPU: 232.8 MB]  File "/soft/anaconda/envs/topaz/lib/python3.6/multiprocessing/pool.py", line 119, in worker
[CPU: 232.8 MB]  File "/soft/anaconda/envs/topaz/lib/python3.6/site-packages/topaz/utils/data/loader.py", line 58, in load_tiff
[CPU: 232.8 MB]  image = load_pil(path, standardize=standardize)
[CPU: 232.8 MB]  result = (True, func(*args, **kwds))
[CPU: 232.8 MB]  image = Image.open(path)
[CPU: 232.8 MB]  File "/soft/anaconda/envs/topaz/lib/python3.6/site-packages/topaz/utils/data/loader.py", line 97, in load_pil
[CPU: 232.8 MB]  File "/soft/anaconda/envs/topaz/lib/python3.6/site-packages/topaz/commands/normalize.py", line 60, in __call__
[CPU: 232.8 MB]  File "/soft/anaconda/envs/topaz/lib/python3.6/site-packages/PIL/Image.py", line 2904, in open
[CPU: 232.8 MB]  return load_tiff(path, standardize=standardize)
[CPU: 232.8 MB]  x = np.array(load_image(path), copy=False).astype(np.float32)
[CPU: 232.8 MB]  fp = builtins.open(filename, "rb")
[CPU: 232.8 MB]  File "/soft/anaconda/envs/topaz/lib/python3.6/site-packages/topaz/utils/data/loader.py", line 58, in load_tiff
[CPU: 232.8 MB]  File "/soft/anaconda/envs/topaz/lib/python3.6/site-packages/topaz/utils/data/loader.py", line 105, in load_image
[CPU: 232.8 MB]  IsADirectoryError: [Errno 21] Is a directory: '/mnt/DATA/user/BE_20220916/P170/'

Loader.py is probably trying to concatenate an empty string to the cryosparc root folder?