Comments (13)
While I am still concerned about the above code, it seems the exception can be tracked to lines 276-279 in datasets.py. In my interpretation the loop runs over all classes and assumes a filename is present in each, which I guess, is not the case if not every class was annotated? Or is this an assumption now?
from rootpainter3d.
Thanks for the extra details. The code is wrong as far as I can tell - I think it should not assume that every class is annotated.
Just for my reference, this is related to: #30
I will look into both soon and propose a fix.
from rootpainter3d.
I've managed to reproduce the issue now, or at least I am getting errors with missing validation annotations that I should not be. I'm working on an automated test. Will update when I have more progress.
from rootpainter3d.
Note:
We may want to look into a consider the implications of the following code:
RootPainter3D/trainer/im_utils.py
Line 336 in bedb9dc
See how this line assume that dirs and fnames correspond:
https://github.com/Abe404/RootPainter3D/blob/bedb9dc66d0c7d8cb9bfde2d0b4c2eedfd99cd6a/trainer/im_utils.py#LL338C8-L338C8
But we converted the dirs to a set before this. Can we rely on consistent ordering?
Also it looks like we only get a single instance of each scan, if we use a set? So the validation set would only include a single class for each scan and other annotations would be ignored for this scan?
from rootpainter3d.
I have written a failing integration test for this now:
67a18ff
Next step is a failing unit test that better isolates the problem in im_utils.py
from rootpainter3d.
Failing unit test now implemented: 9552497
(depends on the commit after it to run).
it doesn't isolate the problem quite as much as I would like (which I think would require some refactoring and I don't want to shave the yak too much) but it shows what is going wrong in terms of patch refs not having the correct directories in a multi class project.
from rootpainter3d.
Unit test now passing:
c528ba2
But it looks like there's still a problem with the integration test.
The validation code still assumes there's an annotation for every class for every image in the validation set.
RootPainter3D/trainer/datasets.py
Line 286 in c528ba2
from rootpainter3d.
Integration test now passing also.
7b14aa0
I believe this is fixed but I will try some more manual testing with everything running connected to the GUI just to make sure.
from rootpainter3d.
I'm occasionally getting this issue when testing with the total segment dataset: #34
It is intermittent due to the test picking random images. I will aim to address this soon (as a separate issue).
from rootpainter3d.
#34 is almost finished. I will close both issues once all tests pass and I've tested it out manually.
I think #29 might also need a bit more work for the manual test to go well.
from rootpainter3d.
This is fixed now. Please let me know if you run into any more problems.
from rootpainter3d.
I found another issue related to this so re-opening.
There is a problem with the function load_train_image_and_annot
RootPainter3D/trainer/im_utils.py
Line 246 in 3bfdbe5
It is supposed to always return a matching list of class names and annotations. When force_fg is true it may not return annotations that do not have any foreground (as these should not be used in training) but it still returns the corresponding class, leading to a mismatch between the list of classes and list of annotations, which causes an exception in the loss function.
This means training can crash for projects where only the background is annotated for some images, without any foreground annotated.
This is the test that revealed the bug:
0a701df
(testing multi class training works on total segmentor dataset).
from rootpainter3d.
I found another issue related to this so re-opening.
There is a problem with the function load_train_image_and_annot
RootPainter3D/trainer/im_utils.py
Line 246 in 3bfdbe5
It is supposed to always return a matching list of class names and annotations. When force_fg is true it may not return annotations that do not have any foreground (as these should not be used in training) but it still returns the corresponding class, leading to a mismatch between the list of classes and list of annotations, which causes an exception in the loss function.
This means training can crash for projects where only the background is annotated for some images, without any foreground annotated.
This is the test that revealed the bug: 0a701df
(testing multi class training works on total segmentor dataset).
Fixed with: 0449648
from rootpainter3d.
Related Issues (20)
- Clearer contribution guidelines HOT 1
- Usage instructions unclear HOT 4
- handle floating point values in images HOT 1
- ignore 'hidden' files when creating a project HOT 1
- auto-build HOT 3
- RootPainter max workers specifiable HOT 2
- Input images with floats in [0,1] are displayed as all black
- "Redo" and "Save annotation" both have Ctrl + Shift + Z as shortcut HOT 1
- Support 3 views
- estimate time remaining when segmenting folder
- Remove incorrect comment HOT 1
- have patch size as input argument HOT 1
- Enable annotations to be assigned to segmentations HOT 3
- Stop making strange transforms when loading images HOT 3
- Multiclass train/validation split is made repeatedly across each class HOT 1
- force_fg triggers too many retries exception which kills server HOT 4
- CryptographyDeprecationWarning HOT 1
- handle images that are smaller than patch size HOT 3
- Upgrade client to PyQt6
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 rootpainter3d.