Open Ysc-shark opened 9 months ago
torch.save()
with torhc.float32 data type (so you do not need to convert afterwards). Then, during training, you can load torch tensors with torch.load()
. Even faster (but less neat), if you pass your gpu device in a map_location
argument of torch.load()
, you can load them directly onto your GPU without loading them onto a CPU beforehand.
- For multiscale patches and features see: TCGA-lung: please share the training-validation / test split #67
- The current code supports 1 slide per batch, so you can not utilise a greater portion of your GPU
- Loading features from csv's with pandas, extracting numpy arrays, converting to torch tensors and putting on a GPU is slow. You can go through all csv files once before training and save the features as torch tensors with
torch.save()
with torhc.float32 data type (so you do not need to convert afterwards). Then, during training, you can load torch tensors withtorch.load()
. Even faster (but less neat), if you pass your gpu device in amap_location
argument oftorch.load()
, you can load them directly onto your GPU without loading them onto a CPU beforehand.
Thanks for your reply, it's very helpful to me. I have two more questions to ask
@Ysc-shark
python deepzoom_tiler.py -m 0 2 -b 20 -d CAMELYON16 -v tif
will extract patches with 20×+5× magnifications under 2 conditions:
-o
argument to change it), which would be incorrect for 40x slides. https://github.com/binli123/dsmil-wsi/blob/1e8f11128843e65438c9609267d6ad2d6d190692/deepzoom_tiler.py#L163@Ysc-shark
- For me, the downloaded multiscale features were split into separate zip files. I extracted the contents and put them together. There were no other complications.
This command
python deepzoom_tiler.py -m 0 2 -b 20 -d CAMELYON16 -v tif
will extract patches with 20×+5× magnifications under 2 conditions:
- objective magnification of the scanner is correctly parsed from the slide metadata (usually there, but sometimes is not): Otherwise, the default objective of 20x will be used (you can specify
-o
argument to change it), which would be incorrect for 40x slides. https://github.com/binli123/dsmil-wsi/blob/1e8f11128843e65438c9609267d6ad2d6d190692/deepzoom_tiler.py#L163- levels downsamples go as powers of 2 (should be a standard, but is not) and not powers of 4: https://github.com/binli123/dsmil-wsi/blob/1e8f11128843e65438c9609267d6ad2d6d190692/deepzoom_tiler.py#L166 For example, the code assumes that for slide with 20x original magnification, level 0 corresponds to downsample factor of 2^0=1 and keeps 20x magnification, while level 2 corresponds to downsample factor of 2^2=4 making it 5x magnification. However, sometimes scanners produce images with powers of 4, in which case level 0 will still have the downsampling factor of 2^0=1 and keep 20x magnification, while level 1 will have the downsampling factor of 4^1=4 with 5x magnification.
Thanks a lot
Hi,thanks for sharing your great work and it really helps me a lot.I have 2 questions to ask.
First,Your paper discusses experiments with 20×+5× multiscale features, showing promising results. However, the downloadable features appear to be only from the single-scale 20× resolution. Could you please provide the 20×+5× features?
Second,I tried running the model on the features you provided, but the model's execution speed is quite slow. It takes nearly 2 days to complete 200 epochs, and the GPU utilization remains around 2% throughout the process. The GPU memory usage is also very low, only consuming a small portion. I'm using a Tesla P100 GPU. Is this normal? How can I improve the execution speed?
Many thanks, Yu Sicheng