royerlab / cytoself

Self-supervised models for encoding protein localization patterns from microscopy images

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pickling error running CytoselfFullTrainer

sheryllin111 opened this issue · comments

Hi, I've installed cytoself via cloning from this repo / dev instructions and tried running the example scripts but ran into this error.
Screenshot 2023-11-14 151158
Screenshot 2023-11-14 151215

commented

The error can be avoided by removing parallel processing from the dataloader like shown in the example below:

from cytoself.datamanager.opencell import DataManagerOpenCell

data_ch = ['pro', 'nuc']
datapath = 'Testdata' # path to download sample data
DataManagerOpenCell.download_sample_data(datapath) # donwload data
datamanager = DataManagerOpenCell(datapath, data_ch, fov_col=None)
datamanager.const_dataloader(batch_size=32, num_workers=1, label_name_position=1)
datamanager.train_loader.num_workers=0
datamanager.val_loader.num_workers=0
datamanager.test_loader.num_workers=0

Thank you @gitclipp for finding a solution. This seems a specific problem on windows. I have no problem running it on Ubuntu, and I do have problem of Can't pickle on windows. I've also seen issues on multiprocessing when running pytorch on windows. There might be some compatibility issues between recent python's multiprocessing and windows.