Giter VIP home page Giter VIP logo

Comments (6)

hizhangp avatar hizhangp commented on August 23, 2024

You should finetune from the pretrained model.

from yolo_tensorflow.

wonny2001 avatar wonny2001 commented on August 23, 2024

how to finetune ?
this codes doesn't have a finetue? just for test??
if then, please make a comment on tutorial..

from yolo_tensorflow.

hizhangp avatar hizhangp commented on August 23, 2024

Please refer to train.py, it gives you an example about how to finetune a model from pretrained weight.

from yolo_tensorflow.

wonny2001 avatar wonny2001 commented on August 23, 2024

You mean like code below?

135 def main():
136 parser = argparse.ArgumentParser()
137 parser.add_argument('--weights', default="YOLO_small.ckpt", type=str)
138 parser.add_argument('--data_dir', default="data", type=str)
139 parser.add_argument('--threshold', default=0.2, type=float)
140 parser.add_argument('--iou_threshold', default=0.5, type=float)
141 parser.add_argument('--gpu', default='', type=str)

The thing is,
Why i try with only pretrained model??

I want to change or add more "slim.conv2d" on below codes,
(ex. net = slim.conv2d(net, 256, 1, scope='conv_11_2'))
To do this, i need to train from "WEIGHTS_FILE = None" unless it gives me error (bcz pretrained model is not same to mode which i changed)

55 net = tf.pad(images, np.array([[0, 0], [3, 3], [3, 3], [0, 0]]), name='pad_1')
56 net = slim.conv2d(net, 64, 7, 2, padding='VALID', scope='conv_2')
57 net = slim.max_pool2d(net, 2, padding='SAME', scope='pool_3')
58 net = slim.conv2d(net, 192, 3, scope='conv_4')
59 net = slim.max_pool2d(net, 2, padding='SAME', scope='pool_5')
60 net = slim.conv2d(net, 128, 1, scope='conv_6')
61 net = slim.conv2d(net, 256, 3, scope='conv_7')
62 net = slim.conv2d(net, 256, 1, scope='conv_8')
63 net = slim.conv2d(net, 512, 3, scope='conv_9')
64 net = slim.max_pool2d(net, 2, padding='SAME', scope='pool_10')
65 net = slim.conv2d(net, 256, 1, scope='conv_11')
66 net = slim.conv2d(net, 512, 3, scope='conv_12')
67 net = slim.conv2d(net, 256, 1, scope='conv_13')
68 net = slim.conv2d(net, 512, 3, scope='conv_14')
69 net = slim.conv2d(net, 256, 1, scope='conv_15')
70 net = slim.conv2d(net, 512, 3, scope='conv_16')
71 net = slim.conv2d(net, 256, 1, scope='conv_17')
72 net = slim.conv2d(net, 512, 3, scope='conv_18')
73 net = slim.conv2d(net, 512, 1, scope='conv_19')
74 net = slim.conv2d(net, 1024, 3, scope='conv_20')
75 net = slim.max_pool2d(net, 2, padding='SAME', scope='pool_21')
76 net = slim.conv2d(net, 512, 1, scope='conv_22')
77 net = slim.conv2d(net, 1024, 3, scope='conv_23')
78 net = slim.conv2d(net, 512, 1, scope='conv_24')
79 net = slim.conv2d(net, 1024, 3, scope='conv_25')
80 net = slim.conv2d(net, 1024, 3, scope='conv_26')
81 net = tf.pad(net, np.array([[0, 0], [1, 1], [1, 1], [0, 0]]), name='pad_27')
82 net = slim.conv2d(net, 1024, 3, 2, padding='VALID', scope='conv_28')
83 net = slim.conv2d(net, 1024, 3, scope='conv_29')
84 net = slim.conv2d(net, 1024, 3, scope='conv_30')
85 net = tf.transpose(net, [0, 3, 1, 2], name='trans_31')
86 net = slim.flatten(net, scope='flat_32')
87 net = slim.fully_connected(net, 512, scope='fc_33')
88 net = slim.fully_connected(net, 4096, scope='fc_34')
89 net = slim.dropout(net, keep_prob=keep_prob,
90 is_training=is_training, scope='dropout_35')
91 net = slim.fully_connected(net, num_outputs,
92 activation_fn=None, scope='fc_36')

from yolo_tensorflow.

hizhangp avatar hizhangp commented on August 23, 2024

If you add extra layers, you should avoid loading these layers' weight from pretrainded model.

from yolo_tensorflow.

feitiandemiaomi avatar feitiandemiaomi commented on August 23, 2024

@wonny2001 Hi , I met the smilar question , How do you solve it ?

from yolo_tensorflow.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.