Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty paths in frocwrtdetpepchluna16.py #4

Closed
ghost opened this issue Feb 28, 2018 · 14 comments
Closed

Empty paths in frocwrtdetpepchluna16.py #4

ghost opened this issue Feb 28, 2018 · 14 comments

Comments

@ghost
Copy link

ghost commented Feb 28, 2018

Dear Team,
I am trying to run frocwrtdetpepchluna16.py. Do I have to generate these files for each fold or did you already do that?

annotations_filename = # path for ground truth annotations for the fold
annotations_excluded_filename = # path for excluded annotations for the fold
seriesuids_filename = # path for seriesuid for the fold

Best,

@ghost
Copy link
Author

ghost commented Feb 28, 2018

/usr/bin/python3.5 /home/nec/shlomo/db/dev/thirdparty/DeepLung/evaluationScript/noduleCADEvaluationLUNA16.py
./annotations/annotations.csv
Error file name: ./annotations/annotations.csv, exception : iterator should return strings, not bytes (did you open the file in text mode?)
Error file name: ./annotations/annotations_excluded.csv, exception : iterator should return strings, not bytes (did you open the file in text mode?)
Error file name: ./annotations/seriesuids.csv, exception : iterator should return strings, not bytes (did you open the file in text mode?)
Total number of included nodule annotations: 0
Total number of nodule annotations: 0
Error file name: ./annotations/3DRes18FasterR-CNN.csv, exception : iterator should return strings, not bytes (did you open the file in text mode?)
Traceback (most recent call last):
  File "/home/nec/shlomo/db/dev/thirdparty/DeepLung/evaluationScript/noduleCADEvaluationLUNA16.py", line 589, in <module>
    noduleCADEvaluation(annotations_filename,annotations_excluded_filename,seriesuids_filename,results_filename,'./')
  File "/home/nec/shlomo/db/dev/thirdparty/DeepLung/evaluationScript/noduleCADEvaluationLUNA16.py", line 581, in noduleCADEvaluation
    numberOfBootstrapSamples=bNumberOfBootstrapSamples, confidence=bConfidence)
  File "/home/nec/shlomo/db/dev/thirdparty/DeepLung/evaluationScript/noduleCADEvaluationLUNA16.py", line 414, in evaluateCAD
    nodOutputfile.write("    Average number of candidates per scan: %.9f\n" % (float(totalNumberOfCands) / float(len(seriesUIDs))))
ZeroDivisionError: float division by zero

Process finished with exit code 1

@ghost
Copy link
Author

ghost commented Feb 28, 2018

For python 3:

def readCSV(filename):
    lines = []
    try:
        with open(filename, "rt",  encoding="utf-8") as f:
            csvreader = csv.reader(f)
            for line in csvreader:
                lines.append(line)
    except Exception as e:
        print('Error file name: {}, exception : {}'.format(filename, e))

    return lines

@wentaozhu
Copy link
Owner

  1. Yes. Because we need to validate the performance of each fold typically. The LUNA16 only provides the annotation for the entire dataset. You need to split them into the 10 folds for validation.

  2. I am very sorry for the error. How about running 'noduleCADEvaluationLUNA16compare.py' in the evaluationScript folder. I just upload the file. You can get the visualization results for DPN model (I also uploaded the DPN prediction results). For the ResNet evaluation, I think the encoding of the csv file has some problem. You are welcomed to help solve the problem. I am very busy recently. If you can not solve it, remind me next week and I can solve it. Thank you for your contribution!

  3. I use python 2.7.14 Anaconda for the environment.

@ghost
Copy link
Author

ghost commented Mar 1, 2018

Thanks for the reply! I converted the code to Python 3.5.

You need to split them into the 10 folds for validation.
I was able to run /evaluationScript/frocwrtdetpepchluna16.py, and produce FROC, and I did NOT split the CSV, I saw in the code that fold=9, however, I am puzzled how does this work if these lines are commented out?

Additionally, do you have a script for splitting the CSV into 10 folds?
Best,

@ghost
Copy link

ghost commented Mar 6, 2018

Also,
Can you share the code for creating the Visualizations in Figures 7 and 8 in the paper?

@wentaozhu
Copy link
Owner

@bayesianio The LUNA16 provides the splitting of 10 folds. You can download it from the website https://luna16.grand-challenge.org/download/

@wentaozhu
Copy link
Owner

@QuantScientist I think you mean the visualization of detection results. You can just use matplotlib to plot the annotation ground truth, the prediction. Because there are all in the numpy array format.

For circle plot, you can calculate if b1 < np.square(x - center) < b2: x = 1 else: x = 0 You can get it from the generated mask x.

@ghost
Copy link

ghost commented Mar 7, 2018

Thanks,
In line 153 in layers.py, this error is thrown:

selection_022

_, idcs = torch.topk(neg_output, min(num_hard, len(neg_output)))

RuntimeError: dimension specified as -1 but tensor has no dimensions

I decreased the batch size to 4, but I do not think this is related.

@wentaozhu
Copy link
Owner

It shows you do not have negative samples. Check your label and data loader process file.

@ghost
Copy link

ghost commented Mar 7, 2018

It shows you do not have negative samples. Check your label and data loader process file.

Pre-processing completed successfully. Which process was supposed to generate the negative samples?

@wentaozhu
Copy link
Owner

Check detector/data.py line 380-311. The shape of numpy array representing the returned negative samples.

@MjdMahasneh
Copy link

Thanks for the reply! I converted the code to Python 3.5.

You need to split them into the 10 folds for validation.
I was able to run /evaluationScript/frocwrtdetpepchluna16.py, and produce FROC, and I did NOT split the CSV, I saw in the code that fold=9, however, I am puzzled how does this work if these lines are commented out?

Additionally, do you have a script for splitting the CSV into 10 folds?
Best,

Hello @deeponcology , did you convert the entire code to Python 3? I am working on this at the moment, was wondering which parts did you particularly have to change?
for example, am trying to evaluate the division operations '/' to make sure they have consistent behaviour in Python 3.5, with that in the original Python 2.7 implementation.
Was that one thing you had to look for? and what other things did you notice that needs looking after?

Obviously, if you share your scripts, that would be immensely helpful! otherwise, any elaboration and advice would be extremely appreciated. Please, and thank you in advance.

@ghost
Copy link

ghost commented Feb 17, 2021

It was over two years ago ... I don't even have the code at my possession anymore!

@MjdMahasneh
Copy link

It was over two years ago ... I don't even have the code at my possession anymore!

@QuantScientist that's fine, If you have any advice on what to look for when converting the scripts to Python 3, that would of very much help, just a few comments maybe, otherwise, thank you for taking the time to respond.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants