TFFRCNN icon indicating copy to clipboard operation
TFFRCNN copied to clipboard

How to slove this problem(LookupError: No gradient defined for operation 'pool_5' (op type: RoiPool))

Open wafoon opened this issue 7 years ago • 2 comments

/home/fermion/anaconda3/lib/python3.5/site-packages/tensorflow/python/ops/gradients_impl.py:93: UserWarning: Converting sparse IndexedSlices to a dense Tensor of unknown shape. This may consume a large amount of memory. "Converting sparse IndexedSlices to a dense Tensor of unknown shape. " Traceback (most recent call last): File "/home/fermion/anaconda3/lib/python3.5/site-packages/tensorflow/python/ops/gradients_impl.py", line 530, in gradients grad_fn = ops.get_gradient_function(op) File "/home/fermion/anaconda3/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 1644, in get_gradient_function return _gradient_registry.lookup(op_type) File "/home/fermion/anaconda3/lib/python3.5/site-packages/tensorflow/python/framework/registry.py", line 93, in lookup "%s registry has no entry for: %s" % (self._name, name)) LookupError: gradient registry has no entry for: RoiPool

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "./faster_rcnn/train_net.py", line 109, in restore=bool(int(args.restore))) File "./faster_rcnn/../lib/fast_rcnn/train.py", line 400, in train_net sw.train_model(sess, max_iters, restore=restore) File "./faster_rcnn/../lib/fast_rcnn/train.py", line 142, in train_model grads, norm = tf.clip_by_global_norm(tf.gradients(loss, tvars), 10.0) File "/home/fermion/anaconda3/lib/python3.5/site-packages/tensorflow/python/ops/gradients_impl.py", line 534, in gradients (op.name, op.type)) LookupError: No gradient defined for operation 'pool_5' (op type: RoiPool)

wafoon avatar Jun 07 '17 08:06 wafoon

Have u ever solved this problem? I encountered the same problem.I will be appreciated it if u could tell me how to solve it.

yuace avatar Apr 26 '18 11:04 yuace

In my case, "import roi_pooling_op_grad" is comment out by mistake, reverse it the problem solved. TFFRCNN/lib/roi_pooling_layer/init.py #import roi_pooling_op_grad import roi_pooling_op_grad

cococyx avatar Oct 17 '18 07:10 cococyx