Showing
1 changed file
with
3 additions
and
3 deletions
... | @@ -1751,7 +1751,7 @@ | ... | @@ -1751,7 +1751,7 @@ |
1751 | " ### Model definition\n", | 1751 | " ### Model definition\n", |
1752 | " yolo_model = yolov3(class_num, anchors, use_label_smooth, use_focal_loss, batch_norm_decay, weight_decay, use_static_shape=False)\n", | 1752 | " yolo_model = yolov3(class_num, anchors, use_label_smooth, use_focal_loss, batch_norm_decay, weight_decay, use_static_shape=False)\n", |
1753 | "\n", | 1753 | "\n", |
1754 | - " with tf.variable_scope('yolov3', reuse=True):\n", | 1754 | + " with tf.variable_scope('yolov3', reuse=tf.AUTO_REUSE):\n", |
1755 | " pred_feature_maps = yolo_model.forward(image, is_training=is_training)\n", | 1755 | " pred_feature_maps = yolo_model.forward(image, is_training=is_training)\n", |
1756 | "\n", | 1756 | "\n", |
1757 | " loss = yolo_model.compute_loss(pred_feature_maps, y_true)\n", | 1757 | " loss = yolo_model.compute_loss(pred_feature_maps, y_true)\n", |
... | @@ -1989,7 +1989,7 @@ | ... | @@ -1989,7 +1989,7 @@ |
1989 | "\n", | 1989 | "\n", |
1990 | " ### Model definition\n", | 1990 | " ### Model definition\n", |
1991 | " yolo_model = yolov3(args.class_num, args.anchors)\n", | 1991 | " yolo_model = yolov3(args.class_num, args.anchors)\n", |
1992 | - " with tf.variable_scope('yolov3', reuse=True):\n", | 1992 | + " with tf.variable_scope('yolov3', reuse=tf.AUTO_REUSE):\n", |
1993 | " pred_feature_maps = yolo_model.forward(image, is_training=is_training)\n", | 1993 | " pred_feature_maps = yolo_model.forward(image, is_training=is_training)\n", |
1994 | " loss = yolo_model.compute_loss(pred_feature_maps, y_true)\n", | 1994 | " loss = yolo_model.compute_loss(pred_feature_maps, y_true)\n", |
1995 | " y_pred = yolo_model.predict(pred_feature_maps)\n", | 1995 | " y_pred = yolo_model.predict(pred_feature_maps)\n", |
... | @@ -2083,7 +2083,7 @@ | ... | @@ -2083,7 +2083,7 @@ |
2083 | " with tf.Session() as sess:\n", | 2083 | " with tf.Session() as sess:\n", |
2084 | " input_data = tf.placeholder(tf.float32, [1, args.new_size[1], args.new_size[0], 3], name='input_data')\n", | 2084 | " input_data = tf.placeholder(tf.float32, [1, args.new_size[1], args.new_size[0], 3], name='input_data')\n", |
2085 | " yolo_model = yolov3(args.num_class, args.anchors)\n", | 2085 | " yolo_model = yolov3(args.num_class, args.anchors)\n", |
2086 | - " with tf.variable_scope('yolov3', reuse=True):\n", | 2086 | + " with tf.variable_scope('yolov3', reuse=tf.AUTO_REUSE):\n", |
2087 | " pred_feature_maps = yolo_model.forward(input_data, False)\n", | 2087 | " pred_feature_maps = yolo_model.forward(input_data, False)\n", |
2088 | " pred_boxes, pred_confs, pred_probs = yolo_model.predict(pred_feature_maps)\n", | 2088 | " pred_boxes, pred_confs, pred_probs = yolo_model.predict(pred_feature_maps)\n", |
2089 | "\n", | 2089 | "\n", | ... | ... |
-
Please register or login to post a comment