yolo_tensorflow icon indicating copy to clipboard operation
yolo_tensorflow copied to clipboard

InvalidArgumentError (see above for traceback): Assign requires shapes of both tensors to match. lhs shape= [539] rhs shape= [1470]

Open zyyhl opened this issue 6 years ago • 2 comments

InvalidArgumentError (see above for traceback): Assign requires shapes of both tensors to match. lhs shape= [539] rhs shape= [1470] [[Node: save/Assign_52 = Assign[T=DT_FLOAT, _class=["loc:@yolo/fc_36/biases"], use_locking=true, validate_shape=true, _device="/job:localhost/replica:0/task:0/gpu:0"](yolo/fc_36/biases, save/RestoreV2_52/_5)]]

I trained my own data set and only one class has this problem

zyyhl avatar Apr 05 '18 17:04 zyyhl

@zyyhl Hi, could you solve it? I am facing the same issue.

mldm4 avatar May 30 '18 20:05 mldm4

well,I guess you used your own dataset. I also encountered such a problem.But I found a solution. as follows: I believe you have your own training model under the output path. so,You don't need the modelYOLO_small.ckpt provided by the author.

you should comment out the code:

self.saver = tf.train.Saver() self.saver.restore(self.sess, self.weights_file)

and,add the code:

self.saver = tf.train.import_meta_graph(MODEL_SAVE_PATH + "yolo-14000.meta") self.saver.restore(self.sess, tf.train.latest_checkpoint(MODEL_SAVE_PATH))

MODEL_SAVE_PATH Is the path your model is saved.

祝你们好运!

OverrideSkywalker avatar Nov 09 '18 02:11 OverrideSkywalker