File explore_model_summary.py changed (mode: 100644) (index d5f3bc4..9d5c32d) |
1 |
|
from models import CompactCNN, AttnCanAdcrowdNetSimpleV3, CompactDilatedCNN |
|
|
1 |
|
from models import CompactCNN, AttnCanAdcrowdNetSimpleV3, CompactDilatedCNN, DefDilatedCCNN |
2 |
2 |
from torchsummary import summary |
from torchsummary import summary |
3 |
3 |
|
|
4 |
4 |
def very_simple_param_count(model): |
def very_simple_param_count(model): |
|
... |
... |
def very_simple_param_count(model): |
6 |
6 |
return result |
return result |
7 |
7 |
|
|
8 |
8 |
if __name__ == "__main__": |
if __name__ == "__main__": |
9 |
|
print("Compact CNN") |
|
10 |
|
ccnn = CompactCNN() |
|
11 |
|
print(ccnn) |
|
12 |
|
print("-------------") |
|
13 |
|
# print(summary(ccnn, (3, 128, 128))) # we print twice to confirm trainable parameter independent with input size |
|
14 |
|
print("-------------") |
|
15 |
|
print(summary(ccnn, (3, 512, 512))) |
|
16 |
|
print("simple count", very_simple_param_count(ccnn)) |
|
17 |
|
print("===========================================================================") |
|
|
9 |
|
# print("Compact CNN") |
|
10 |
|
# ccnn = CompactCNN() |
|
11 |
|
# print(ccnn) |
|
12 |
|
# print("-------------") |
|
13 |
|
# # print(summary(ccnn, (3, 128, 128))) # we print twice to confirm trainable parameter independent with input size |
|
14 |
|
# print("-------------") |
|
15 |
|
# print(summary(ccnn, (3, 512, 512))) |
|
16 |
|
# print("simple count", very_simple_param_count(ccnn)) |
|
17 |
|
# print("===========================================================================") |
|
18 |
|
# print("dilate ccnn") |
|
19 |
|
# dcnn1 = CompactDilatedCNN() |
|
20 |
|
# print(summary(dcnn1, (3, 512, 512))) |
|
21 |
|
# print("=============================================================================") |
18 |
22 |
print("dilate ccnn") |
print("dilate ccnn") |
19 |
|
dcnn = CompactDilatedCNN() |
|
20 |
|
print(summary(dcnn, (3, 512, 512))) |
|
|
23 |
|
dcnn2 = DefDilatedCCNN() |
|
24 |
|
print(summary(dcnn2, (3, 512, 512))) |
21 |
25 |
print("=============================================================================") |
print("=============================================================================") |
22 |
26 |
# print("simple_v3") |
# print("simple_v3") |
23 |
27 |
# simplev3 = AttnCanAdcrowdNetSimpleV3() |
# simplev3 = AttnCanAdcrowdNetSimpleV3() |
File train_script/CCNN/ccnn_v3_t1_c2.sh copied from file train_script/CCNN/ccnn_v3_t1.sh (similarity 59%) (mode: 100644) (index a3102e5..4fef813) |
1 |
1 |
CUDA_VISIBLE_DEVICES=6 nohup python train_compact_cnn.py \ |
CUDA_VISIBLE_DEVICES=6 nohup python train_compact_cnn.py \ |
2 |
|
--task_id ccnn_v3_t1 \ |
|
|
2 |
|
--task_id ccnn_v3_t1_c2 \ |
3 |
3 |
--input /data/rnd/thient/thient_data/ShanghaiTech/part_A \ |
--input /data/rnd/thient/thient_data/ShanghaiTech/part_A \ |
4 |
4 |
--lr 1e-5 \ |
--lr 1e-5 \ |
5 |
5 |
--decay 5e-5 \ |
--decay 5e-5 \ |
|
6 |
|
--load_model saved_model/ccnn_v3_t1_checkpoint_478800.pth \ |
6 |
7 |
--datasetname shanghaitech_keepfull \ |
--datasetname shanghaitech_keepfull \ |
7 |
|
--epochs 401 > logs/ccnn_v3_t1.log & |
|
|
8 |
|
--epochs 401 > logs/ccnn_v3_t1_c2.log & |