Skip to content

Commit c55c198

Browse files
authored
add grep
1 parent 0135b24 commit c55c198

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tutorial/train_shape.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -465,13 +465,13 @@
465465
"source": [
466466
"#get latest weight file\n",
467467
"%cd logs/shape\n",
468-
"weight_file = !ls -Art | tail -n 1\n",
468+
"weight_file = !ls -Art | grep efficientdet\n",
469469
"%cd ../..\n",
470470
"\n",
471471
"#uncomment the next line to specify a weight file\n",
472-
"#weight_file[0] = 'efficientdet-d0_49_1400.pth'\n",
472+
"#weight_file[-1] = 'efficientdet-d0_49_1400.pth'\n",
473473
"\n",
474-
"! python coco_eval.py -c 0 -p shape -w \"logs/shape/{weight_file[0]}\""
474+
"! python coco_eval.py -c 0 -p shape -w \"logs/shape/{weight_file[-1]}\""
475475
],
476476
"execution_count": 4,
477477
"outputs": [
@@ -583,7 +583,7 @@
583583
" ratios=[(1.0, 1.0), (1.4, 0.7), (0.7, 1.4)],\n",
584584
" scales=[2 ** 0, 2 ** (1.0 / 3.0), 2 ** (2.0 / 3.0)])\n",
585585
"\n",
586-
"model.load_state_dict(torch.load('logs/shape/'+weight_file[0]))\n",
586+
"model.load_state_dict(torch.load('logs/shape/'+weight_file[-1]))\n",
587587
"model.requires_grad_(False)\n",
588588
"model.eval()\n",
589589
"\n",

0 commit comments

Comments
 (0)