Giter VIP home page Giter VIP logo

Comments (15)

okunator avatar okunator commented on May 26, 2024

Hi,

This is a pytorch-lightning error. Basically, you just need to pass n_devices argument to the pl.Trainer to fix this.

from cellseg_models.pytorch.

Transformer-man avatar Transformer-man commented on May 26, 2024

Thank you for your help. But I seem to have encountered another problem. How to import a trained model into prediction。
When I use the following code
experiment = experiment.load_state_dict(torch.load('./version_0/checkpoints/epoch=149-step=49800.ckpt'))
QQ截图20230320112516

from cellseg_models.pytorch.

okunator avatar okunator commented on May 26, 2024

Can you be a bit more specific so I can get a hang of what you're trying to achieve. In general, you should not try to load the state dict to theSegmentationExperiment object. Instead, you should load the weights into a nn.Module object and use that as an input to the SegmentationExperiment

from cellseg_models.pytorch.

Transformer-man avatar Transformer-man commented on May 26, 2024

I have already solved this problem. I would like to ask how to save the best model results on the validation set. In addition, may I ask you how to validate a test set? Thank you very much.

from cellseg_models.pytorch.

okunator avatar okunator commented on May 26, 2024

You can save your checkpoints with pytorch-lightning ModelCheckpoint class. Ory ou can just add a ckpt_path to the trainenr.fit method: trainer.fit(model, ckpt_path="some/path/to/my_checkpoint.ckpt"). Check out the lightning checkpointing documentation: https://lightning.ai/docs/pytorch/stable/common/checkpointing_intermediate.html

from cellseg_models.pytorch.

okunator avatar okunator commented on May 26, 2024

For benchmarking: see this benchmarking notebook: https://github.com/okunator/cellseg_models.pytorch/blob/main/examples/pannuke_cellpose_benchmark.ipynb

from cellseg_models.pytorch.

Transformer-man avatar Transformer-man commented on May 26, 2024

Thank you very much. I'm going to learn now

from cellseg_models.pytorch.

Transformer-man avatar Transformer-man commented on May 26, 2024

Hello, I'm training pannuke_nuclei_segmentation_stardist.ipynb, I found that you have enhanced the data used for images and masks. The first dimension of the mask is a cell count map, and the second dimension is a nuclear category map. However, the first dimension is used in your code. Is there a problem?

QQ截图20230323110221
QQ截图20230323110244

from cellseg_models.pytorch.

Transformer-man avatar Transformer-man commented on May 26, 2024

Should we use a second dimensional cell category mask instead of a cell technology mask?

from cellseg_models.pytorch.

Transformer-man avatar Transformer-man commented on May 26, 2024

I trained 150 epochs using default parameters, and the test results seemed very unsatisfactory.pannuke_nuclei_segmentation_stardist.ipynb
QQ截图20230323141021

from cellseg_models.pytorch.

okunator avatar okunator commented on May 26, 2024

Hello, I'm training pannuke_nuclei_segmentation_stardist.ipynb, I found that you have enhanced the data used for images and masks. The first dimension of the mask is a cell count map, and the second dimension is a nuclear category map. However, the first dimension is used in your code. Is there a problem?

QQ截图20230323110221 QQ截图20230323110244

No there is not a problem, the data flow is such that the instance mask and the semantic masks are transformed separately since they require different kinds of transformations. I'm not quite sure what you mean about enhancing data but applying augmentations during the data loading is a routine practice and if you wish to not use augmentations you don't have to

from cellseg_models.pytorch.

okunator avatar okunator commented on May 26, 2024

I trained 150 epochs using default parameters, and the test results seemed very unsatisfactory.pannuke_nuclei_segmentation_stardist.ipynb QQ截图20230323141021

Stardist is not easy to train on multi-class problems and requires a lot of regularization or other bias mitigation since the learning of the radial distance maps dominate the gradient updates during training. You might want to try out cellpose or hover-net instead for pannuke data.

from cellseg_models.pytorch.

Transformer-man avatar Transformer-man commented on May 26, 2024

Thank you for your help

from cellseg_models.pytorch.

Transformer-man avatar Transformer-man commented on May 26, 2024

Hello, but I used the training set to test indicators and found that there are two categories that are also 0. Is there any problem?
QQ截图20230324203913

from cellseg_models.pytorch.

okunator avatar okunator commented on May 26, 2024

No, it just mean that the model did not learn to recognize those categories.

from cellseg_models.pytorch.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.