Comments (8)
Yes, I did something similar to this. In my case I explicitly wanted the computations to be on the gpu. I edited the utils.py
file in the pathml package like this:
In line 73 write: true_1_hot = torch.eye(num_classes + 1).to('cuda:0')[true.squeeze(1)]
You also have to add .to('cuda:0')
to the tensor in line 84 (the else block).
Until now the program runs. I couldn't test a full training so far, because it needs to long. (17 hours for a full training. Is this normal?)
But the outer for loop ran for two iterations without error.
from pathml.
I have the exact same problem. I also run it on HPC but with 2 GPUs, each having 15G memory.
I think it has something to do with the newest torch version 1.13.0: pytorch/pytorch#90194
So far I couldn't resolve the problem.
Did you (or anybody else) find a solution?
from pathml.
Is this happening because torch.eye()
is created on cpu but the true
array has already been sent to the device? If so, maybe it would help to create the torch.eye on the same device, e.g. something like: true_1_hot = torch.eye(num_classes + 1, device = device)[true.squeeze(1)]
. Or, you could try sending them all to cpu, something like true_1_hot = torch.eye(num_classes + 1)[true.cpu().squeeze(1)]
from pathml.
@WilliWespe how to edit the utils.py in pathml? I clone the pathml to hpc, then edit the utils.py, and use the second method to install pathml. But, there are several errors.
from pathml.
Well, in my case i first changed my directory to miniconda3/envs/py38/lib/python3.8/site-packages/pathml/ml
.
Then I opened utils.py
with nano
and edited/saved it. After that restart your notebook.
Was this your question?
from pathml.
@WilliWespe thanks. Yes, that's my question and it works. I am starting training now.
from pathml.
problem solved
from pathml.
Thank you all for the discussion above!
Can confirm the patch above still works in 2024 with pathml 2.1.1
from pathml.
Related Issues (20)
- Support GPUs on Docker installation
- preprocessing on mrxs file get h5 file full of 0 HOT 6
- necrotic tissue detection for HE and multiplex imaging
- Need assistance with running Pathml package via Colab or Docker and resolving errors HOT 6
- Tests are failing HOT 2
- Error with spams package in vahadane stain normalisation with StainNormalizationHE() HOT 2
- Make a smaller docker image
- Reading WSI with .tif and ome.tiff format HOT 14
- Implement Tile Stitching Feature in Image Preprocessing
- Unable to read in all image layers in .vdi file, only index 0 is read in HOT 3
- Use updated openslide v4.0.0 HOT 1
- Add Installation and Setup Instructions for Mamba alongside Conda HOT 1
- http://pathml.org/ image broken HOT 1
- Algorithm for Improved Spectral Unmixing with Reference Image Integration
- add install instructions for windows HOT 1
- Compatibility Query: Using PathML for X-Ray Images with Missing 'TotalPixelMatrixRows' Attribute
- AttributeError pathml.core HOT 8
- pachage install bug
- Unable to Load IMC data (ome.tiff format) properly. Image data appears 0 only...
- add Digital Pathology Assistant notebook HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pathml.