Skip to content
This repository has been archived by the owner on Feb 22, 2020. It is now read-only.

Reactivate tests and clear models #306

Merged
merged 2 commits into from
Feb 1, 2018

Conversation

vessemer
Copy link
Contributor

@vessemer vessemer commented Jan 31, 2018

Refactoring of evaluate_detection.py and uncommented tests in test_classification.py, as was mentioned in this comment. Remove redundant self.scale_factor which is neither dependend on DATA_SHAPE nor on self.input_shape by this and this. Remove redundant self.scale_factor which was neither dependend on DATA_SHAPE nor on self.input_shape by this and this.

CLA

  • I have signed the CLA; if other committers are in the commit history, they have signed the CLA as well

@vessemer vessemer mentioned this pull request Jan 31, 2018
1 task
predicted = trained_model.predict(dicom_paths[0], nodule_locations, model_path)
assert predicted
assert 0 <= predicted[0]['p_concerning'] <= 1


Copy link
Contributor

@reubano reubano Jan 31, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if this will pass travis or hit the memory error issue... I think we may need to move this hunk over to #307.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the current Travis log and previous one from PR #298 whit commented test, classification model is not responsible for the memory errosrs.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmmm, looks like they all failed with a memory error...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@reubano reubano Jan 31, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, the latest commit also failed as well... so at least we know the error isn't due to these PRs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This error occurred due to re-estimation of coordinates and fixed in PR #308

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@reubano, thank you for the remarks, I've checked locally and turns out that the issue was not only in DATA_SHAPE but also in memory leak when using tensorflow, thus I've added clear_session() as it was suggested and it corrects the situation for me.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also include an ability to clear model along with pull_ct and pull_patches which may be useful if feed will be called more than once for the same Model instance. Though, those proprieties can't be responsible for the memory errors. I'll rerun locally with htop to provide the information of RAM load.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

screenshot from 2018-02-01 00-33-26
screenshot from 2018-02-01 00-34-55
screenshot from 2018-02-01 00-35-40
screenshot from 2018-02-01 00-36-21
screenshot from 2018-02-01 00-38-43
screenshot from 2018-02-01 00-45-07
screenshot from 2018-02-01 00-47-44
screenshot from 2018-02-01 00-52-15

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you can see the main impact in memory error was made from the segmentation itself.

@vessemer vessemer force-pushed the refactoring branch 2 times, most recently from dacd9e5 to 2df7b6c Compare January 31, 2018 22:22

correct_detection = compare_results(detections, annotations)
print 'number of correct_detection:', correct_detection
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Odd, how did this work before? I mean, Py2 vs Py3 etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It didn't :) Even more, I don't understand the purpose of evaluate_detection.py, 'cause in PR #301:

We extend the IoU calculation from 2D to 3D but in order to be simple, we only deal with 3D boxes / cubes. Although the detections we have are 3D spheres output from the grt123 system. The threshold we currently use is 0.5 but can easily be changed (‘correct_detection_threshold’ in evaluate_detection.py). We also did some experiments using different thresholds, please check the evaluation results below.

The thing is that do the same for 3D spheres even easier 'cause you have to deal with centroids and diameters only (which are given) no need to compute bboxes. That evaluation was proposed by the LUNA16 authors and was adjusted in PR #292

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@reubano reubano changed the title Refactoring Reactivate tests and clear keras models Feb 1, 2018
@reubano reubano changed the title Reactivate tests and clear keras models Reactivate tests and clear models Feb 1, 2018
@vessemer
Copy link
Contributor Author

vessemer commented Feb 1, 2018

All rebased after #307, tests have been passed.

@reubano reubano merged commit a434336 into drivendataorg:master Feb 1, 2018
@vessemer vessemer deleted the refactoring branch February 1, 2018 15:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants