smallcorgi / Faster-RCNN_TF

Faster-RCNN in Tensorflow
MIT License
2.34k stars 1.12k forks source link

ValueError: operands could not be broadcast together #160

Open hadign20 opened 7 years ago

hadign20 commented 7 years ago

I am trying to run faster rcnn on a custom dataset. After 5000 iterations suddenly this error shows up:

Traceback (most recent call last):
  File "./tools/train_net.py", line 96, in <module>
    max_iters=args.max_iters)
  File "/home/hadi/Software/tensorflow/TEST_FRCN_ROOT/tools/../lib/fast_rcnn/train.py", line 267, in train_net
    sw.train_model(sess, max_iters)
  File "/home/hadi/Software/tensorflow/TEST_FRCN_ROOT/tools/../lib/fast_rcnn/train.py", line 198, in train_model
    self.snapshot(sess, iter)
  File "/home/hadi/Software/tensorflow/TEST_FRCN_ROOT/tools/../lib/fast_rcnn/train.py", line 61, in snapshot
    sess.run(net.bbox_weights_assign, feed_dict={net.bbox_weights: orig_0 * np.tile(self.bbox_stds, (weights_shape[0], 1))})
ValueError: operands could not be broadcast together with shapes (4096,84) (4096,40) 

My images are of size 1024*1024.

hadign20 commented 7 years ago

I changed the value of n_classes in TEST_FRCN_ROOT/lib/networks/VGGnet_train.py file from 21 to 10 and the error went away, but there is another problem now. After the iterations of training are done, it repeatedly prompts a line as:Waiting for /home/hadi/Software/tensorflow/TEST_FRCNROOT/output/faster‌​rcnn_end2end/voc_200‌​7_trainval/VGGnet_fa‌​st_rcnn_iter_10.ckpt to exist... . What can I do here?