question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

What transform I should have in order to use LabelSample

See original GitHub issue

Hello, I run into this issue while creating dataloader using torchio. I defined a sampler with LabelSampler, and it gives me this error:

RuntimeError: Empty probability map found: ...
Voxels with positive probability might be near the image border.
If you suspect that this is the case, try adding a padding transform

The transform I’m using is

training_transform = tio.Compose([
    tio.ToCanonical(),
    tio.Pad(int(patch_size[0]/2)),
    tio.CropOrPad(patch_size),
    tio.ZNormalization(masking_method=tio.ZNormalization.mean),
    tio.OneHot(3),
])

I means I have to pad after cropandpad?

Thanks

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
fepegarcommented, Mar 9, 2021

In that case, you might want to lower the max_queue_length.

1reaction
fepegarcommented, Mar 9, 2021

[Please use syntax highlighting for code snippets]

Given the size of your volumes and patches, I suggest using a larger number of samples per volume, maybe 30 or 50. That will be less computationally expensive, as you will need to load and transform volumes less often.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The Label element - HTML: HyperText Markup Language | MDN
This means that, for example, a screen reader will read out the ... a <label> element with an <input> element, you first need...
Read more >
Label Transform | Vega
The label transform should be applied to a text mark whose input data is the base mark to label. That is, the text...
Read more >
Label Encoding in Python Explained - Great Learning
In label encoding in python, we replace the categorical value with a numeric value between 0 and the number of classes minus 1....
Read more >
sklearn.preprocessing.LabelEncoder
Encode target labels with value between 0 and n_classes-1. This transformer should be used to encode target values, i.e. y , and not...
Read more >
Deep dive into multi-label classification..! (With detailed Case ...
Problem transformation methods transform the multi-label problem into a set of binary classification problems, which can then be handled using ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found