Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No OpKernel was registered to support Op 'RoiPoolGrad' with these attrs #18

Closed
SeanTyco opened this issue Jan 26, 2017 · 2 comments
Closed

Comments

@SeanTyco
Copy link

SeanTyco commented Jan 26, 2017

I am following the readme training script for the VOC database but I'm running into the following error for the ROI pooling layer:

Traceback (most recent call last):
  File "./faster_rcnn/train_net.py", line 109, in <module>
    restore=bool(int(args.restore)))
  File "./faster_rcnn/../lib/fast_rcnn/train.py", line 396, in train_net
    sw.train_model(sess, max_iters, restore=restore)
  File "./faster_rcnn/../lib/fast_rcnn/train.py", line 144, in train_model
    sess.run(tf.initialize_all_variables())
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 766, in run
    run_metadata_ptr)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 964, in _run
    feed_dict_string, options, run_metadata)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1014, in _do_run
    target_list, options, run_metadata)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1034, in _do_call
    raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: No OpKernel was registered to support Op 'RoiPoolGrad' with these attrs.  Registered devices: [CPU], Registered kernels:
  device='GPU'; T in [DT_FLOAT]

	 [[Node: gradients/pool_5_grad/RoiPoolGrad = RoiPoolGrad[T=DT_FLOAT, pooled_height=7, pooled_width=7, spatial_scale=0.0625](conv5_3/conv5_3, roi-data/rois, pool_5:1, gradients/fc6/transpose_grad/transpose)]]

Caused by op u'gradients/pool_5_grad/RoiPoolGrad', defined at:
  File "./faster_rcnn/train_net.py", line 109, in <module>
    restore=bool(int(args.restore)))
  File "./faster_rcnn/../lib/fast_rcnn/train.py", line 396, in train_net
    sw.train_model(sess, max_iters, restore=restore)
  File "./faster_rcnn/../lib/fast_rcnn/train.py", line 138, in train_model
    grads, norm = tf.clip_by_global_norm(tf.gradients(loss, tvars), 10)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/gradients_impl.py", line 482, in gradients
    in_grads = grad_fn(op, *out_grads)
  File "./faster_rcnn/../lib/roi_pooling_layer/roi_pooling_op_grad.py", line 41, in _roi_pool_grad
    data_grad = roi_pooling_op.roi_pool_grad(data, rois, argmax, grad, pooled_height, pooled_width, spatial_scale)
  File "<string>", line 74, in roi_pool_grad
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/op_def_library.py", line 759, in apply_op
    op_def=op_def)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 2240, in create_op
    original_op=self._default_original_op, op_def=op_def)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 1128, in __init__
    self._traceback = _extract_stack()

...which was originally created as op u'pool_5', defined at:
  File "./faster_rcnn/train_net.py", line 101, in <module>
    network = get_network(args.network_name)
  File "./faster_rcnn/../lib/networks/factory.py", line 27, in get_network
    return VGGnet_train()
  File "./faster_rcnn/../lib/networks/VGGnet_train.py", line 17, in __init__
    self.setup()
  File "./faster_rcnn/../lib/networks/VGGnet_train.py", line 84, in setup
    .roi_pool(7, 7, 1.0/16, name='pool_5')
  File "./faster_rcnn/../lib/networks/network.py", line 27, in layer_decorated
    layer_output = op(self, layer_input, *args, **kwargs)
  File "./faster_rcnn/../lib/networks/network.py", line 183, in roi_pool
    name=name)[0]
  File "<string>", line 45, in roi_pool
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/op_def_library.py", line 759, in apply_op
    op_def=op_def)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 2240, in create_op
    original_op=self._default_original_op, op_def=op_def)

InvalidArgumentError (see above for traceback): No OpKernel was registered to support Op 'RoiPoolGrad' with these attrs.  Registered devices: [CPU], Registered kernels:
  device='GPU'; T in [DT_FLOAT]

	 [[Node: gradients/pool_5_grad/RoiPoolGrad = RoiPoolGrad[T=DT_FLOAT, pooled_height=7, pooled_width=7, spatial_scale=0.0625](conv5_3/conv5_3, roi-data/rois, pool_5:1, gradients/fc6/transpose_grad/transpose)]]

I'm not really sure what this means. Has anyone else run into this issue when training?

My dev environment:
Tensorflow:0.12.1
GPU/CPU:GPU
Python: 2.7.6
Operating System: Ubuntu 14.04

@SeanTyco
Copy link
Author

Also, I can run the demo fine but the training is an issue.

@SeanTyco
Copy link
Author

Closing, I accidentally installed "tensorflow" instead of "tensorflow-gpu" on the machine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant