Topaz training results in IndexError

Hi all, I am using Topaz 0.3.7 with Cryosparc 4.7.0. Topaz is installed with conda using python 3.12.0. A Topaz training run ends with an Index error, like this:

# Loaded 22 training micrographs with ~6609 labeled particles
# Loaded 5 testing micrographs with 1446 labeled particles
# Done!
Training command complete.
Training done in 7519.425s.
--------------------------------------------------------------
Traceback (most recent call last):
  File "cryosparc_master/cryosparc_compute/run.py", line 129, in cryosparc_master.cryosparc_compute.run.main
  File "/home/exx/software/cryosparc/cryosparc_worker/cryosparc_compute/jobs/topaz/run_topaz.py", line 420, in run_topaz_wrapper_train
    test_rows = n.where(train_test_data[:, type_index] == 'test')[0]
IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed

Topaz devs suggest:

This looks to me like a problem with cryosparc reading the training output file from topaz. It’s hard to say without knowing extract what train_test_data represents, but it seems that train_test_data is a 1D array where it is expecting the 2D array containing the train/test category, loss, precision, etc.

This could happen if the file is read with spaces as the separator instead of tabs, because each line would be read as a single long string. I’m not sure how much control you have over the file parsing.

Please see the guide for installation of a (older) Topaz version that is compatible with the CryoSPARC job wrapper for Topaz. We have recorded support for a newer Topaz version as a feature request.

2 Likes