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

TypeError: cond() got an unexpected keyword argument 'true_fn' #4

Closed
lfdeep opened this issue Jun 7, 2018 · 2 comments
Closed

TypeError: cond() got an unexpected keyword argument 'true_fn' #4

lfdeep opened this issue Jun 7, 2018 · 2 comments

Comments

@lfdeep
Copy link

lfdeep commented Jun 7, 2018

hello,when i run python train.py, it occured:
Traceback (most recent call last):
File "train.py", line 230, in
train()
File "train.py", line 35, in train
is_training=True)
File "../data/io/read_tfrecord.py", line 83, in next_batch
is_training=is_training)
File "../data/io/read_tfrecord.py", line 57, in read_and_prepocess_single_img
target_shortside_len=shortside_len)
File "../data/io/image_preprocess.py", line 27, in short_side_resize
false_fn=lambda: (target_shortside_len * h//w, target_shortside_len))
TypeError: cond() got an unexpected keyword argument 'true_fn'

@Kongsea
Copy link
Owner

Kongsea commented Jun 8, 2018

Maybe it's because your TensorFlow version is too old. There is actually a keyword argument true_fn in the newest version.

@lfdeep
Copy link
Author

lfdeep commented Jun 8, 2018

Thank you! you are right.After solving this problem, I encountered another problem:

Caused by op u'fast_rcnn_loss/fast_rcnn_minibatch/roi_visualize/crop_img_object', defined at:
File "train.py", line 232, in
train()
File "train.py", line 119, in train
fast_rcnn_location_loss, fast_rcnn_classification_loss = fast_rcnn.fast_rcnn_loss()
File "../libs/fast_rcnn/build_fast_rcnn.py", line 244, in fast_rcnn_loss
minibatch_label_one_hot = self.fast_rcnn_minibatch(self.fast_rcnn_all_level_proposals)
File "../libs/fast_rcnn/build_fast_rcnn.py", line 221, in fast_rcnn_minibatch
roi_visualize(self.img_batch, img_h, img_w, positive_proposals, positive_rois)
File "../libs/box_utils/visualization.py", line 28, in roi_visualize
name='crop_img_object'
File "/share/home/math.text/anaconda2/lib/python2.7/site-packages/tensorflow/python/ops/gen_image_ops.py", line 178, in crop_and_resize
name=name)
File "/share/home/math.text/anaconda2/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 768, in apply_op
op_def=op_def)
File "/share/home/math.text/anaconda2/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2336, in create_op
original_op=self._default_original_op, op_def=op_def)
File "/share/home/math.text/anaconda2/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 1228, in init
self._traceback = _extract_stack()

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

     [[Node: fast_rcnn_loss/fast_rcnn_minibatch/roi_visualize/crop_img_object = CropAndResize[T=DT_UINT8, extrapolation_value=0, method="bilinear"](fast_rcnn_loss/fast_rcnn_minibatch/roi_visualize/ExpandDims, fast_rcnn_loss/fast_rcnn_minibatch/roi_visualize/transpose, fast_rcnn_loss/fast_rcnn_minibatch/roi_visualize/zeros, fast_rcnn_loss/fast_rcnn_minibatch/roi_visualize/crop_img_object/crop_size)]]

@Kongsea Kongsea closed this as completed Jul 24, 2018
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

2 participants