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

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

Open
jusforwork15 opened this issue Nov 14, 2024 · 0 comments

Comments

@jusforwork15
Copy link

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

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

1 participant