Skip to content

Commit 3f17db7

Browse files
committed
added current rcnn version, initial analysis tools
1 parent 29b3419 commit 3f17db7

File tree

81 files changed

+31967
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+31967
-0
lines changed

.vscode/launch.json

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "Python: Current File",
9+
"type": "python",
10+
"request": "launch",
11+
"program": "${file}",
12+
"console": "integratedTerminal",
13+
"cwd": "${fileDirname}"
14+
}
15+
]
16+
}

analysis/log_parser.py

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
import matplotlib.pyplot as plt
2+
3+
4+
5+
log_path = "../logs/"
6+
#filename = "log.traintest_03-18_17-08-23.3DCE 1 image 3 slice" #previous run, random 30%, no annealing, 10 epochs
7+
8+
#filename = "log.traintest_04-16_08-08-30.3DCE 1 image 3 slice" #Smaller test run, 10 epochs 10% sampling
9+
filename = "log.traintest_04-16_09-45-43.3DCE 1 image 3 slice" #Latest run with sim_annealing, 10% sampling
10+
11+
12+
epoch=[]
13+
epoch_time=[]
14+
epoch_time_accumulated=[]
15+
epoch_validate=[]
16+
epochn=0
17+
18+
fio = open(log_path+filename, "r")
19+
for line in fio:
20+
if 'Time cost' in line:
21+
#print(line)
22+
s = line.split('=')
23+
s[-1] = s[-1].strip() #remove the \n
24+
#print(s)
25+
epoch_time.append(float(s[1]))
26+
epoch.append(float(epochn))
27+
epochn=epochn+1
28+
29+
if len(epoch_time_accumulated) == 0:
30+
epoch_time_accumulated.append(float(s[1]))
31+
else:
32+
epoch_time_accumulated.append(epoch_time_accumulated[-1]+float(s[1]))
33+
34+
#Note: The validation criteria for 3DCE uses Sensitivity @ 4, in the log files.
35+
if 'Sensitivity' in line:
36+
#print(line)
37+
s=line.split(':')
38+
s[-1] = s[-1].strip() #remove the \n
39+
r = s[-1].split()
40+
#print(r)
41+
epoch_validate.append(float(r[3]))
42+
43+
44+
fio.close()
45+
46+
print(epoch)
47+
print(epoch_time)
48+
print(epoch_time_accumulated)
49+
print(epoch_validate)
50+
51+
plt.plot(epoch, epoch_validate)
52+
plt.ylabel('sensitivity')
53+
plt.xlabel('# of epochs')
54+
plt.show()
55+
56+
57+
plt.plot(epoch_time_accumulated, epoch_validate)
58+
plt.ylabel('sensitivity')
59+
plt.xlabel('epoch_time (s)')
60+
plt.show()

loadModules.sh

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#/bin/bash
2+
3+
module unload python
4+
module load anaconda/Anaconda2
5+
module load cuda/9.0
6+
conda activate CADLab
7+
conda activate py2
8+
9+
python --version
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
+ echo Logging output to '/home/pulido/CADLab/lesion_detector_3DCE/3DCE_new/./log.traintest_03-18_14-15-13.3DCE 1 image 3 slice'
2+
Logging output to /home/pulido/CADLab/lesion_detector_3DCE/3DCE_new/./log.traintest_03-18_14-15-13.3DCE 1 image 3 slice
3+
+ python /home/pulido/CADLab/lesion_detector_3DCE/3DCE_new/./rcnn/tools/train.py
4+
Traceback (most recent call last):
5+
File "/home/pulido/CADLab/lesion_detector_3DCE/3DCE_new/./rcnn/tools/train.py", line 15, in <module>
6+
from rcnn.core import callback, metric
7+
File "/home/pulido/CADLab/lesion_detector_3DCE/3DCE_new/rcnn/tools/../../rcnn/core/callback.py", line 6, in <module>
8+
from rcnn.tools.validate import validate
9+
File "/home/pulido/CADLab/lesion_detector_3DCE/3DCE_new/rcnn/tools/../../rcnn/tools/validate.py", line 4, in <module>
10+
from rcnn.tools.test import test_rcnn
11+
File "/home/pulido/CADLab/lesion_detector_3DCE/3DCE_new/rcnn/tools/../../rcnn/tools/test.py", line 15, in <module>
12+
from rcnn.utils.load_data import filter_roidb
13+
File "/home/pulido/CADLab/lesion_detector_3DCE/3DCE_new/rcnn/tools/../../rcnn/utils/load_data.py", line 55
14+
def sample_roidb(roidb, target)
15+
^
16+
SyntaxError: invalid syntax

logs/log.traintest_03-18_14-21-33.3DCE 1 image 3 slice

+682
Large diffs are not rendered by default.

logs/log.traintest_03-18_17-08-23.3DCE 1 image 3 slice

+1,064
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
+ echo Logging output to '/home/pulido/CADLab/lesion_detector_3DCE/3DCE_new/./log.traintest_04-15_16-52-42.3DCE 1 image 3 slice'
2+
Logging output to /home/pulido/CADLab/lesion_detector_3DCE/3DCE_new/./log.traintest_04-15_16-52-42.3DCE 1 image 3 slice
3+
+ python /home/pulido/CADLab/lesion_detector_3DCE/3DCE_new/./rcnn/tools/train.py
4+
File "/home/pulido/CADLab/lesion_detector_3DCE/3DCE_new/./rcnn/tools/train.py", line 225
5+
begin_epoch=args.begin_epoch, num_epoch=args.e2e_epoch, roidb)
6+
SyntaxError: non-keyword arg after keyword arg
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
+ echo Logging output to '/home/pulido/CADLab/lesion_detector_3DCE/3DCE_new/./log.traintest_04-15_16-53-55.3DCE 1 image 3 slice'
2+
Logging output to /home/pulido/CADLab/lesion_detector_3DCE/3DCE_new/./log.traintest_04-15_16-53-55.3DCE 1 image 3 slice
3+
+ python /home/pulido/CADLab/lesion_detector_3DCE/3DCE_new/./rcnn/tools/train.py
4+
Traceback (most recent call last):
5+
File "/home/pulido/CADLab/lesion_detector_3DCE/3DCE_new/./rcnn/tools/train.py", line 15, in <module>
6+
from rcnn.core import callback, metric
7+
File "/home/pulido/CADLab/lesion_detector_3DCE/3DCE_new/rcnn/tools/../../rcnn/core/callback.py", line 6, in <module>
8+
from rcnn.tools.validate import validate
9+
File "/home/pulido/CADLab/lesion_detector_3DCE/3DCE_new/rcnn/tools/../../rcnn/tools/validate.py", line 4, in <module>
10+
from rcnn.tools.test import test_rcnn
11+
File "/home/pulido/CADLab/lesion_detector_3DCE/3DCE_new/rcnn/tools/../../rcnn/tools/test.py", line 12, in <module>
12+
from rcnn.core.tester import Predictor, pred_eval
13+
File "/home/pulido/CADLab/lesion_detector_3DCE/3DCE_new/rcnn/tools/../../rcnn/core/tester.py", line 9, in <module>
14+
from module import MutableModule
15+
File "/home/pulido/CADLab/lesion_detector_3DCE/3DCE_new/rcnn/tools/../../rcnn/core/module.py", line 230
16+
def fit(self, train_data,ogdb, eval_data=None, eval_metric='acc',
17+
SyntaxError: duplicate argument 'ogdb' in function definition
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
+ echo Logging output to '/home/pulido/CADLab/lesion_detector_3DCE/3DCE_new/./log.traintest_04-15_16-56-12.3DCE 1 image 3 slice'
2+
Logging output to /home/pulido/CADLab/lesion_detector_3DCE/3DCE_new/./log.traintest_04-15_16-56-12.3DCE 1 image 3 slice
3+
+ python /home/pulido/CADLab/lesion_detector_3DCE/3DCE_new/./rcnn/tools/train.py
4+
/home/pulido/CADLab/lesion_detector_3DCE/3DCE_new/rcnn/tools/../../rcnn/config.py:176: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
5+
yaml_cfg = edict(yaml.load(f))
6+
INFO:root:{'ANCHOR_RATIOS': [0.5, 1, 2],
7+
'ANCHOR_SCALES': [2, 3, 4, 6, 12],
8+
'CLASS_NAMES': ['bg', 'lesion'],
9+
'FIXED_PARAMS': [],
10+
'FIXED_PARAMS_SHARED': ['conv1', 'conv2', 'conv3', 'conv4', 'conv5'],
11+
'FRAMEWORK': '3DCE',
12+
'GT_MARGIN': 0,
13+
'IMAGE_STRIDE': 0,
14+
'IMG_DO_CLIP': True,
15+
'MAX_SIZE': 512,
16+
'NORM_SPACING': 0.8,
17+
'NUM_ANCHORS': 15,
18+
'NUM_CLASSES': 2,
19+
'NUM_IMAGES_3DCE': 1,
20+
'NUM_SLICES': 3,
21+
'PIXEL_MEANS': array([50]),
22+
'RCNN_FEAT_STRIDE': 8,
23+
'RPN_FEAT_STRIDE': 8,
24+
'SCALE': 512,
25+
'SLICE_INTV': 2,
26+
'TEST': {'CXX_PROPOSAL': False,
27+
'HAS_RPN': False,
28+
'NMS': 0.3,
29+
'PROPOSAL_MIN_SIZE': 8,
30+
'PROPOSAL_NMS_THRESH': 0.7,
31+
'PROPOSAL_POST_NMS_TOP_N': 2000,
32+
'PROPOSAL_PRE_NMS_TOP_N': 20000,
33+
'RPN_MIN_SIZE': 8,
34+
'RPN_NMS_THRESH': 0.7,
35+
'RPN_POST_NMS_TOP_N': 300,
36+
'RPN_PRE_NMS_TOP_N': 6000,
37+
'SAMPLES_PER_BATCH': 1},
38+
'TRAIN': {'ASPECT_GROUPING': False,
39+
'BATCH_ROIS': 32,
40+
'BBOX_MEANS': [0.0, 0.0, 0.0, 0.0],
41+
'BBOX_NORMALIZATION_PRECOMPUTED': True,
42+
'BBOX_NORMALIZE_TARGETS': False,
43+
'BBOX_REGRESSION_THRESH': 0.5,
44+
'BBOX_STDS': [0.1, 0.1, 0.2, 0.2],
45+
'BBOX_WEIGHTS': array([1., 1., 1., 1.]),
46+
'BG_THRESH_HI': 0.5,
47+
'BG_THRESH_LO': 0.0,
48+
'CXX_PROPOSAL': False,
49+
'END2END': True,
50+
'FG_FRACTION': 0.25,
51+
'FG_THRESH': 0.5,
52+
'RCNN_POS_UPSAMPLE': False,
53+
'RCNN_REG_LOSS_WEIGHT': 10,
54+
'RPN_BATCH_SIZE': 32,
55+
'RPN_BBOX_WEIGHTS': [1.0, 1.0, 1.0, 1.0],
56+
'RPN_CLOBBER_POSITIVES': False,
57+
'RPN_FG_FRACTION': 0.5,
58+
'RPN_MIN_SIZE': 8,
59+
'RPN_NEGATIVE_OVERLAP': 0.3,
60+
'RPN_NMS_THRESH': 0.7,
61+
'RPN_POSITIVE_OVERLAP': 0.7,
62+
'RPN_POSITIVE_WEIGHT': -1.0,
63+
'RPN_POST_NMS_TOP_N': 2000,
64+
'RPN_PRE_NMS_TOP_N': 12000,
65+
'RPN_REG_LOSS_WEIGHT': 1,
66+
'SAMPLES_PER_BATCH': 1},
67+
'WINDOWING': [-1024, 3071]}
68+
INFO:root:{'accs': {},
69+
'base_lr': 0.001,
70+
'begin_epoch': 0,
71+
'dataset': 'DeepLesion',
72+
'dataset_path': '/home/pulido/CADLab/lesion_detector_3DCE/images/',
73+
'e2e_epoch': 10,
74+
'e2e_lr': 0.001,
75+
'e2e_lr_step': '4,5',
76+
'e2e_prefix': 'model/3DCE 1 image 3 slice',
77+
'exp_name': '3DCE 1 image 3 slice',
78+
'flip': False,
79+
'frequent': 100,
80+
'gpus': '0',
81+
'groundtruth_file': '/home/pulido/CADLab/lesion_detector_3DCE/3DCE_new/data/DeepLesion/DL_info.csv',
82+
'image_path': '/home/pulido/CADLab/lesion_detector_3DCE/images/Images_png/',
83+
'image_set': 'train',
84+
'iter_size': 1,
85+
'keep_best_model': True,
86+
'kvstore': 'device',
87+
'lr_factor': 0.1,
88+
'network': 'vgg',
89+
'prefetch_thread_num': 4,
90+
'pretrained': '/home/pulido/CADLab/lesion_detector_3DCE/vgg16',
91+
'pretrained_epoch': 0,
92+
'proposal': 'rpn',
93+
'rand_seed': 23,
94+
'resume': False,
95+
'root_path': '/home/pulido/CADLab/lesion_detector_3DCE/3DCE_new/data',
96+
'show_avg_loss': 100,
97+
'shuffle': True,
98+
'test_image_set': 'test',
99+
'testing': False,
100+
'use_roidb_cache': True,
101+
'val_avg_fp': [0.5, 1, 2, 4, 8, 16],
102+
'val_gpu': '0',
103+
'val_has_rpn': True,
104+
'val_image_set': 'val',
105+
'val_iou_th': 0.5,
106+
'val_max_box': 5,
107+
'val_shuffle': False,
108+
'val_thresh': 0,
109+
'val_vis': False,
110+
'validate_at_begin': False,
111+
'weight_decay': 0.0005,
112+
'work_load_list': None}
113+
INFO:root:DeepLesion_train num_images 22496
114+
INFO:root:DeepLesion_train gt roidb loaded from /home/pulido/CADLab/lesion_detector_3DCE/images/cache/DeepLesion_train_gt_roidb.pkl
115+
INFO:root:noisy boxes filtered, images: 22496 -> 22478, bboxes: 22919 -> 22901
116+
INFO:root:sample boxes filtered, images: 22478 -> 224, bboxes: 22901 -> 22901
117+
INFO:root:Sampling 1 pcnt : 224 training slices
118+
INFO:root:Loading images with 4 threads.
119+
INFO:root:providing maximum shape [('data', (1, 3, 512, 512)), ('gt_boxes', (1, 5, 5))] [('label', (1, 61440)), ('bbox_target', (1, 60, 64, 64)), ('bbox_weight', (1, 60, 64, 64))]
120+
INFO:root:output shape {'bbox_loss_reshape_output': (1, 32, 8),
121+
'blockgrad0_output': (1, 32),
122+
'cls_prob_reshape_output': (1, 32, 2),
123+
'rpn_bbox_loss_output': (1, 60, 27, 16),
124+
'rpn_cls_prob_output': (1, 2, 405, 16)}
125+
INFO:root:loading parameters from /home/pulido/CADLab/lesion_detector_3DCE/vgg16-0000.params
126+
INFO:root:load param done
127+
INFO:root:lr 0.001000 lr_epoch_diff [4.0, 5.0] lr_iters [896, 1120]
128+
INFO:root:Epoch 0 Batch 0 19972876.2 smp/sec RPNLogLoss=0.743, RPNL1Loss=0.0142, RCNNLogLoss=0.694, RCNNL1Loss=1.44e-07,
129+
INFO:root:Epoch 0 Batch 100 10.0 smp/sec RPNLogLoss=0.288, RPNL1Loss=0.033, RCNNLogLoss=0.407, RCNNL1Loss=0.0395,
130+
INFO:root:Epoch 0 Batch 200 10.1 smp/sec RPNLogLoss=0.169, RPNL1Loss=0.0284, RCNNLogLoss=0.394, RCNNL1Loss=0.0752,
131+
INFO:root:Epoch[0] Train-RPNLogLoss=0.161003
132+
INFO:root:Epoch[0] Train-RPNL1Loss=0.021988
133+
INFO:root:Epoch[0] Train-RCNNLogLoss=0.408131
134+
INFO:root:Epoch[0] Train-RCNNL1Loss=0.079635
135+
INFO:root:Epoch[0] Time cost=22.339
136+
INFO:root:Saved checkpoint to "model/3DCE 1 image 3 slice-0001.params"
137+
INFO:root:Validating ...
138+
INFO:root:DeepLesion_val num_images 4793
139+
INFO:root:DeepLesion_val gt roidb loaded from /home/pulido/CADLab/lesion_detector_3DCE/images/cache/DeepLesion_val_gt_roidb.pkl
140+
INFO:root:noisy boxes filtered, images: 4793 -> 4791, bboxes: 4889 -> 4887
141+
INFO:root:Loading images with 4 threads.
142+
INFO:root:loading parameters from model/3DCE 1 image 3 slice-0001.params
143+
INFO:root:im_detect: 0/4791 data 0.065s im_detect 0.051s misc 0.004s
144+
INFO:root:im_detect: 200/4791 data 0.009s im_detect 0.047s misc 0.004s
145+
INFO:root:im_detect: 400/4791 data 0.009s im_detect 0.047s misc 0.004s
146+
600 800 1000 1200 1400 1600 1800 2000 2200 2400 2600 2800 3000 3200 3400 3600 3800 4000 4200 4400 4600
147+
Sensitivity @ [0.5, 1, 2, 4, 8, 16] average FPs per image: [0.00552486 0.01023123 0.0200532 0.0317168 0.05361162 0.08921629]
148+
Iter 1: 0.0317
149+
INFO:root:Validate callback: 0.031717
150+
INFO:root:Returned Validation=0.031717
151+
INFO:root:Retraining data=0.031717
152+
INFO:root:Loading images with 4 threads.
153+
INFO:root:Redoing training to meet criteria=1
154+
Traceback (most recent call last):
155+
File "/home/pulido/CADLab/lesion_detector_3DCE/3DCE_new/./rcnn/tools/train.py", line 255, in <module>
156+
train_net(default)
157+
File "/home/pulido/CADLab/lesion_detector_3DCE/3DCE_new/./rcnn/tools/train.py", line 225, in train_net
158+
begin_epoch=args.begin_epoch, num_epoch=args.e2e_epoch)
159+
File "/home/pulido/CADLab/lesion_detector_3DCE/3DCE_new/rcnn/tools/../../rcnn/core/module.py", line 341, in fit
160+
sroidb = sample_roidb(ogdb, 10)
161+
NameError: global name 'sample_roidb' is not defined

0 commit comments

Comments
 (0)