MouseLand/cellpose

CRITICAL:cellpose.io:ERROR: could not read masks from file, can only convert an array of size 1 to a Python scalar

Opened this issue · 0 comments

Tried to train the model on custom dataset. Faced dataloader issues.

X_train shape: (3984, 256, 256, 3)
X_test shape: (997, 256, 256, 3)
y_train shape: (3984, 256, 256)
y_test shape: (997, 256, 256)

when i try to load the data:
from cellpose import train

start logger (to see training across epochs)

logger = io.logger_setup()

DEFINE CELLPOSE MODEL (without size model)

model = models.CellposeModel(gpu=use_GPU, model_type="nuclei")

train_dir = "/content/drive/MyDrive/CV/train/"
test_dir = "/content/drive/MyDrive/CV/test/"
n_epochs = 10
learning_rate = 0.1
weight_decay = 0.0001
model_name = "CP_tissuenet"

set channels

chan = "Green"
chan2 = "Red"
chan3 = "Blue"
channels = [chan, chan2, chan3]

get files

output = io.load_train_test_data(train_dir, test_dir, mask_filter='_seg.npy')
#output = io.load_train_test_data(train_dir, test_dir, mask_filter='_seg.npy')
#train_data, train_labels, _ , test_data, test_labels, _ = output
#train_data, train_labels, test_data, test_labels = X_train, y_train, X_test, y_test

error: CRITICAL:cellpose.io:ERROR: could not read masks from file, can only convert an array of size 1 to a Python scalar