ysbecca / py-wsi

Python package for dealing with whole slide images (.svs) for machine learning, particularly for fast prototyping. Includes patch sampling and storing using OpenSlide. Patches may be stored in LMDB, HDF5 files, or to disk. It is highly recommended to fork and download this repository so that personal customisations can be made for your work.
https://ysbecca.github.io/programming/2018/05/22/py-wsi.html
GNU General Public License v3.0
161 stars 93 forks source link

py_wsi error: provided label not present in label map #31

Closed WaqasHU closed 3 years ago

WaqasHU commented 4 years ago

Hi, @ysbecca Thanks a lot for such great work! I am beginner in py_wsi...generated xml for my image from aperio software annotation option... but when i executed turtle.sample_and_store_patches(....) it gives me error i copied below...pls suggest some solution..i am strucked at this point... i defined exact labels in label_map i am using py_wsi 1.0...because i unbale to install 2.0.. Waiting..


Setting label as -1 for UNRECOGNISED LABEL. {'Normal': 1, 'Benign': 2, 'Carcinoma in situ': 3, 'In situ carcinoma': 4, 'Invasive carcinoma': 5, 'Carcinoma invasive': 6} py_wsi error: provided label not present in label map. Setting label as -1 for UNRECOGNISED LABEL. {'Normal': 1, 'Benign': 2, 'Carcinoma in situ': 3, 'In situ carcinoma': 4, 'Invasive carcinoma': 5, 'Carcinoma invasive': 6} py_wsi error: provided label not present in label map. Setting label as -1 for UNRECOGNISED LABEL. {'Normal': 1, 'Benign': 2, 'Carcinoma in situ': 3, 'In situ carcinoma': 4, 'Invasive carcinoma': 5, 'Carcinoma invasive': 6} py_wsi error: provided label not present in label map.

ysbecca commented 4 years ago

Hi, this error means that it found a label in the XML that is not in your dictionary (your dictionary contains values 1 through 6). For example, maybe your XML contains 0 as a possible value?

On Thu, 5 Dec 2019, 20:24 WaqasHU, notifications@github.com wrote:

Hi, @ysbecca https://github.com/ysbecca Thanks a lot for such great work! I am beginner in py_wsi...generated xml for my image from aperio software annotation option... but when i executed turtle.sample_and_store_patches(....) it gives me error i copied below...pls suggest some solution..i am strucked at this point... i defined exact labels in label_map i am using py_wsi 1.0...because i unbale to install 2.0.. Waiting..

Setting label as -1 for UNRECOGNISED LABEL. {'Normal': 1, 'Benign': 2, 'Carcinoma in situ': 3, 'In situ carcinoma': 4, 'Invasive carcinoma': 5, 'Carcinoma invasive': 6} py_wsi error: provided label not present in label map. Setting label as -1 for UNRECOGNISED LABEL. {'Normal': 1, 'Benign': 2, 'Carcinoma in situ': 3, 'In situ carcinoma': 4, 'Invasive carcinoma': 5, 'Carcinoma invasive': 6} py_wsi error: provided label not present in label map. Setting label as -1 for UNRECOGNISED LABEL. {'Normal': 1, 'Benign': 2, 'Carcinoma in situ': 3, 'In situ carcinoma': 4, 'Invasive carcinoma': 5, 'Carcinoma invasive': 6} py_wsi error: provided label not present in label map.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ysbecca/py-wsi/issues/31?email_source=notifications&email_token=AAR53PSQQYSD5S4JLYQAAYDQXFPRBA5CNFSM4JWAGVV2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H6NY4OA, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAR53PQ3FEGGZHFNKOCZNV3QXFPRBANCNFSM4JWAGVVQ .

WaqasHU commented 4 years ago

Means its conflict betweeb xml file and labels that i defined in label map

On Fri, Dec 6, 2019, 9:37 PM Rebecca Stone notifications@github.com wrote:

Hi, this error means that it found a label in the XML that is not in your dictionary (your dictionary contains values 1 through 6). For example, maybe your XML contains 0 as a possible value?

On Thu, 5 Dec 2019, 20:24 WaqasHU, notifications@github.com wrote:

Hi, @ysbecca https://github.com/ysbecca Thanks a lot for such great work! I am beginner in py_wsi...generated xml for my image from aperio software annotation option... but when i executed turtle.sample_and_store_patches(....) it gives me error i copied below...pls suggest some solution..i am strucked at this point... i defined exact labels in label_map i am using py_wsi 1.0...because i unbale to install 2.0.. Waiting..

Setting label as -1 for UNRECOGNISED LABEL. {'Normal': 1, 'Benign': 2, 'Carcinoma in situ': 3, 'In situ carcinoma': 4, 'Invasive carcinoma': 5, 'Carcinoma invasive': 6} py_wsi error: provided label not present in label map. Setting label as -1 for UNRECOGNISED LABEL. {'Normal': 1, 'Benign': 2, 'Carcinoma in situ': 3, 'In situ carcinoma': 4, 'Invasive carcinoma': 5, 'Carcinoma invasive': 6} py_wsi error: provided label not present in label map. Setting label as -1 for UNRECOGNISED LABEL. {'Normal': 1, 'Benign': 2, 'Carcinoma in situ': 3, 'In situ carcinoma': 4, 'Invasive carcinoma': 5, 'Carcinoma invasive': 6} py_wsi error: provided label not present in label map.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub < https://github.com/ysbecca/py-wsi/issues/31?email_source=notifications&email_token=AAR53PSQQYSD5S4JLYQAAYDQXFPRBA5CNFSM4JWAGVV2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H6NY4OA , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AAR53PQ3FEGGZHFNKOCZNV3QXFPRBANCNFSM4JWAGVVQ

.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ysbecca/py-wsi/issues/31?email_source=notifications&email_token=AGLMME5H5DTE46G7M7WJSY3QXJ5UVA5CNFSM4JWAGVV2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGEUSZI#issuecomment-562645349, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGLMMEZOYNH6IE2N3GDZKZDQXJ5UVANCNFSM4JWAGVVQ .

WaqasHU commented 4 years ago

Hi, this error means that it found a label in the XML that is not in your dictionary (your dictionary contains values 1 through 6). For example, maybe your XML contains 0 as a possible value? On Thu, 5 Dec 2019, 20:24 WaqasHU, @.***> wrote: Hi, @ysbecca https://github.com/ysbecca Thanks a lot for such great work! I am beginner in py_wsi...generated xml for my image from aperio software annotation option... but when i executed turtle.sample_and_store_patches(....) it gives me error i copied below...pls suggest some solution..i am strucked at this point... i defined exact labels in label_map i am using py_wsi 1.0...because i unbale to install 2.0.. Waiting.. ------------------------------ Setting label as -1 for UNRECOGNISED LABEL. {'Normal': 1, 'Benign': 2, 'Carcinoma in situ': 3, 'In situ carcinoma': 4, 'Invasive carcinoma': 5, 'Carcinoma invasive': 6} py_wsi error: provided label not present in label map. Setting label as -1 for UNRECOGNISED LABEL. {'Normal': 1, 'Benign': 2, 'Carcinoma in situ': 3, 'In situ carcinoma': 4, 'Invasive carcinoma': 5, 'Carcinoma invasive': 6} py_wsi error: provided label not present in label map. Setting label as -1 for UNRECOGNISED LABEL. {'Normal': 1, 'Benign': 2, 'Carcinoma in situ': 3, 'In situ carcinoma': 4, 'Invasive carcinoma': 5, 'Carcinoma invasive': 6} py_wsi error: provided label not present in label map. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#31?email_source=notifications&email_token=AAR53PSQQYSD5S4JLYQAAYDQXFPRBA5CNFSM4JWAGVV2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H6NY4OA>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAR53PQ3FEGGZHFNKOCZNV3QXFPRBANCNFSM4JWAGVVQ .

No dear still same error...i have recreated the xml file through aperio with just 1 annotation...and then given just one value in label_map e.g. label_map = {'Acinar': 1, } but till got this error:


Patch size: 64 Pre-calculated map sizes:

ysbecca commented 4 years ago

Correct.

On Fri, 6 Dec 2019, 16:43 WaqasHU, notifications@github.com wrote:

Means its conflict betweeb xml file and labels that i defined in label map

On Fri, Dec 6, 2019, 9:37 PM Rebecca Stone notifications@github.com wrote:

Hi, this error means that it found a label in the XML that is not in your dictionary (your dictionary contains values 1 through 6). For example, maybe your XML contains 0 as a possible value?

On Thu, 5 Dec 2019, 20:24 WaqasHU, notifications@github.com wrote:

Hi, @ysbecca https://github.com/ysbecca Thanks a lot for such great work! I am beginner in py_wsi...generated xml for my image from aperio software annotation option... but when i executed turtle.sample_and_store_patches(....) it gives me error i copied below...pls suggest some solution..i am strucked at this point... i defined exact labels in label_map i am using py_wsi 1.0...because i unbale to install 2.0.. Waiting..

Setting label as -1 for UNRECOGNISED LABEL. {'Normal': 1, 'Benign': 2, 'Carcinoma in situ': 3, 'In situ carcinoma': 4, 'Invasive carcinoma': 5, 'Carcinoma invasive': 6} py_wsi error: provided label not present in label map. Setting label as -1 for UNRECOGNISED LABEL. {'Normal': 1, 'Benign': 2, 'Carcinoma in situ': 3, 'In situ carcinoma': 4, 'Invasive carcinoma': 5, 'Carcinoma invasive': 6} py_wsi error: provided label not present in label map. Setting label as -1 for UNRECOGNISED LABEL. {'Normal': 1, 'Benign': 2, 'Carcinoma in situ': 3, 'In situ carcinoma': 4, 'Invasive carcinoma': 5, 'Carcinoma invasive': 6} py_wsi error: provided label not present in label map.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <

https://github.com/ysbecca/py-wsi/issues/31?email_source=notifications&email_token=AAR53PSQQYSD5S4JLYQAAYDQXFPRBA5CNFSM4JWAGVV2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H6NY4OA

, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AAR53PQ3FEGGZHFNKOCZNV3QXFPRBANCNFSM4JWAGVVQ

.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub < https://github.com/ysbecca/py-wsi/issues/31?email_source=notifications&email_token=AGLMME5H5DTE46G7M7WJSY3QXJ5UVA5CNFSM4JWAGVV2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGEUSZI#issuecomment-562645349 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AGLMMEZOYNH6IE2N3GDZKZDQXJ5UVANCNFSM4JWAGVVQ

.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ysbecca/py-wsi/issues/31?email_source=notifications&email_token=AAR53PVMV7V3ZXQHVUSDOJLQXJ6M5A5CNFSM4JWAGVV2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGEVG3I#issuecomment-562647917, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAR53PV2TUKSC2TZLONTZ3DQXJ6M5ANCNFSM4JWAGVVQ .

WaqasHU commented 4 years ago

still my error not resolved really struck in this since 3 days...pls help what is issue

WaqasHU commented 4 years ago

Dear Here is my label map: label_map = {'Benign': 1, 'Carcinoma in situ': 2, 'In situ carcinoma': 3, 'Carcinoma invasive': 4, 'Invasive carcinoma': 5, 'Normal': 6, } This is my xml file just showing all layers names i given in Aperio ImageScope from annotations option. Name="Benign" Id="1"> Name="Carcinoma in situ" Id="2"> Name="In situ carcinoma" Id="3"> Name="Carcinoma invasive" Id="4"> Name="Invasive carcinoma" Id="5"> Name="Normal" Id="6"> But Still Getting Error....pls suggest some solution.... ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Patch size: 64 Pre-calculated map sizes:

ysbecca commented 4 years ago

Hi,

It's possible your XML is string values, and the label map is integers, so they don't match? Or perhaps it is matching the Name not the ID value?

On Sun, Dec 8, 2019 at 2:15 PM WaqasHU notifications@github.com wrote:

Dear Here is my label map:

label_map = {'Benign': 1, 'Carcinoma in situ': 2, 'In situ carcinoma': 3, 'Carcinoma invasive': 4, 'Invasive carcinoma': 5, 'Normal': 6, } This is my xml file just showing all layers names i given in Aperio ImageScope from annotations option.

Name="Benign" Id="1"> Name="Carcinoma in situ" Id="2"> Name="In situ carcinoma" Id="3"> Name="Carcinoma invasive" Id="4"> Name="Invasive carcinoma" Id="5"> Name="Normal" Id="6"> But Still Getting Error....pls suggest some solution.... ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Patch size: 64 Pre-calculated map sizes:

  • patch db: 20569522176 bytes
  • meta db: 15304704 bytes Creating new LMDB environment... image1.svs py_wsi error: provided label not present in label map. Setting label as -1 for UNRECOGNISED LABEL. {'Benign': 1, 'Carcinoma in situ': 2, 'In situ carcinoma': 3, 'Carcinoma invasive': 4, 'Invasive carcinoma': 5, 'Normal': 6}.............so on Pls Answer...

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ysbecca/py-wsi/issues/31?email_source=notifications&email_token=AAR53PW6J3L3ZXOODLVKE53QXT6QDA5CNFSM4JWAGVV2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGG7VUA#issuecomment-562952912, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAR53PWZOQJRLWTGDAPHQXLQXT6QDANCNFSM4JWAGVVQ .

WaqasHU commented 4 years ago

Pl check your email at ysbecca@gmail.com

Thankyou

On Wed, Dec 18, 2019, 3:56 PM Rebecca Stone notifications@github.com wrote:

Hi,

It's possible your XML is string values, and the label map is integers, so they don't match? Or perhaps it is matching the Name not the ID value?

On Sun, Dec 8, 2019 at 2:15 PM WaqasHU notifications@github.com wrote:

Dear Here is my label map:

label_map = {'Benign': 1, 'Carcinoma in situ': 2, 'In situ carcinoma': 3, 'Carcinoma invasive': 4, 'Invasive carcinoma': 5, 'Normal': 6, } This is my xml file just showing all layers names i given in Aperio ImageScope from annotations option.

Name="Benign" Id="1"> Name="Carcinoma in situ" Id="2"> Name="In situ carcinoma" Id="3"> Name="Carcinoma invasive" Id="4"> Name="Invasive carcinoma" Id="5"> Name="Normal" Id="6"> But Still Getting Error....pls suggest some solution.... ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Patch size: 64 Pre-calculated map sizes:

  • patch db: 20569522176 bytes
  • meta db: 15304704 bytes Creating new LMDB environment... image1.svs py_wsi error: provided label not present in label map. Setting label as -1 for UNRECOGNISED LABEL. {'Benign': 1, 'Carcinoma in situ': 2, 'In situ carcinoma': 3, 'Carcinoma invasive': 4, 'Invasive carcinoma': 5, 'Normal': 6}.............so on Pls Answer...

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub < https://github.com/ysbecca/py-wsi/issues/31?email_source=notifications&email_token=AAR53PW6J3L3ZXOODLVKE53QXT6QDA5CNFSM4JWAGVV2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGG7VUA#issuecomment-562952912 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AAR53PWZOQJRLWTGDAPHQXLQXT6QDANCNFSM4JWAGVVQ

.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ysbecca/py-wsi/issues/31?email_source=notifications&email_token=AGLMMEYE24HI2FQAE6UKOALQZH6WZA5CNFSM4JWAGVV2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHFXRZQ#issuecomment-566982886, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGLMME2MJNTYFPFISB4JNZTQZH6WZANCNFSM4JWAGVVQ .