wentaozhu / DeepLung

WACV18 paper "DeepLung: Deep 3D Dual Path Nets for Automated Pulmonary Nodule Detection and Classification"
Apache License 2.0
315 stars 143 forks source link

How run frocwrtdetpepchluna16.py ??? #3

Closed blakeliu closed 6 years ago

blakeliu commented 6 years ago

How can create bboxpath???

wentaozhu commented 6 years ago

You need to first get the test results using " for (( i=1; i<=$maxeps; i+=1)) do echo "process $i epoch"

if [ $i -lt 10 ]; then
    CUDA_VISIBLE_DEVICES=2,3,4,5,6,7 python main.py --model res18 -b 32 --resume results/res18/retrft96$f/00$i.ckpt --test 1 --save-dir res18/retrft96$f/ --config config_training$f
elif [ $i -lt 100 ]; then 
    CUDA_VISIBLE_DEVICES=2,3,4,5,6,7 python main.py --model res18 -b 32 --resume results/res18/retrft96$f/0$i.ckpt --test 1 --save-dir res18/retrft96$f/ --config config_training$f
elif [ $i -lt 1000 ]; then
    CUDA_VISIBLE_DEVICES=2,3,4,5,6,7 python main.py --model res18 -b 32 --resume results/res18/retrft96$f/$i.ckpt --test 1 --save-dir res18/retrft96$f/ --config config_training$f
else
    echo "Unhandled case"
fi

if [ ! -d "results/res18/retrft96$f/val$i/" ]; then
    mkdir results/res18/retrft96$f/val$i/
fi
mv results/res18/retrft96$f/bbox/*.npy results/res18/retrft96$f/val$i/

done " in run_training.sh

After you get the test results, you can use it as he bboxpath.

blakeliu commented 6 years ago

when i run run_training.sh `#!/bin/bash set -e

python prepare.py

cd detector maxeps=150 f=9

CUDA_VISIBLE_DEVICES=0,1 python main.py --model res18 -b 4 --resume 064.ckpt --save-dir res18/retrft96$f/ --epochs $maxeps --config config_training$f

for (( i=1; i<=$maxeps; i+=1)) do echo "process $i epoch"

if [ $i -lt 10 ]; then
    CUDA_VISIBLE_DEVICES=0,1 python main.py --model res18 -b 4 --resume results/res18/retrft96$f/00$i.ckpt --test 1 --save-dir res18/retrft96$f/ --config config_training$f
elif [ $i -lt 100 ]; then 
    CUDA_VISIBLE_DEVICES=0,1 python main.py --model res18 -b 4 --resume results/res18/retrft96$f/0$i.ckpt --test 1 --save-dir res18/retrft96$f/ --config config_training$f
elif [ $i -lt 1000 ]; then
    CUDA_VISIBLE_DEVICES=0,1 python main.py --model res18 -b 4 --resume results/res18/retrft96$f/$i.ckpt --test 1 --save-dir res18/retrft96$f/ --config config_training$f
else
    echo "Unhandled case"
fi

if [ ! -d "results/res18/retrft96$f/val$i/" ]; then
    mkdir results/res18/retrft96$f/val$i/
fi
mv results/res18/retrft96$f/bbox/*.npy results/res18/retrft96$f/val$i/

done `

got error : process 1 epoch using gpu 0,1 ['/home/wjy/disk1/datasets/dataBowl2017/luna16/raw/subset0/', '/home/wjy/disk1/datasets/dataBowl2017/luna16/raw/subset1/', '/home/wjy/disk1/datasets/dataBowl2017/luna16/raw/subset2/', '/home/wjy/disk1/datasets/dataBowl2017/luna16/raw/subset3/', '/home/wjy/disk1/datasets/dataBowl2017/luna16/raw/subset4/', '/home/wjy/disk1/datasets/dataBowl2017/luna16/raw/subset5/', '/home/wjy/disk1/datasets/dataBowl2017/luna16/raw/subset6/', '/home/wjy/disk1/datasets/dataBowl2017/luna16/raw/subset7/', '/home/wjy/disk1/datasets/dataBowl2017/luna16/raw/subset8/'] /home/wjy/disk1/datasets/dataBowl2017/luna16/raw/subset0/ /home/wjy/disk1/datasets/dataBowl2017/luna16/raw/subset1/ /home/wjy/disk1/datasets/dataBowl2017/luna16/raw/subset2/ /home/wjy/disk1/datasets/dataBowl2017/luna16/raw/subset3/ /home/wjy/disk1/datasets/dataBowl2017/luna16/raw/subset4/ /home/wjy/disk1/datasets/dataBowl2017/luna16/raw/subset5/ /home/wjy/disk1/datasets/dataBowl2017/luna16/raw/subset6/ /home/wjy/disk1/datasets/dataBowl2017/luna16/raw/subset7/ /home/wjy/disk1/datasets/dataBowl2017/luna16/raw/subset8/ 88 save_dir: results/res18/retrft969/bbox (12L, 1L, 208L, 208L, 208L) 4 Traceback (most recent call last): File "main.py", line 389, in main() File "main.py", line 148, in main test(test_loader, net, get_pbb, save_dir,config) File "main.py", line 338, in test output = split_comber.combine(output,nzhw=nzhw) File "/home/wjy/blake/medical/pulmonary_nodule/DeepLung/detector/split_combine.py", line 63, in combine if nzhw==None: ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

wentaozhu commented 6 years ago

How about change this line to if np.any(nzhw is None):

wentaozhu commented 6 years ago

You can run "noduleCADEvaluationLUNA16compare.py" in the evaluationScript folder to get a sense of the performance.