FPN_Tensorflow icon indicating copy to clipboard operation
FPN_Tensorflow copied to clipboard

convert_data_to_tfrecord.py error!

Open lfdeep opened this issue 7 years ago • 4 comments

****when i run convert_data_to_tfrecord.py, Traceback (most recent call last): File "convert_data_to_tfrecord.py", line 134, in convert_pascal_to_tfrecord() File "convert_data_to_tfrecord.py", line 106, in convert_pascal_to_tfrecord img_height, img_width, gtbox_label = read_xml_gtbox_and_label(xml) File "convert_data_to_tfrecord.py", line 64, in read_xml_gtbox_and_label label = NAME_LABEL_MAP[child_item.text] KeyError: '5' I don't know how to solve this probelms

lfdeep avatar Jun 06 '18 13:06 lfdeep

Make sure that your cfgs.DATASET_NAME in the /lib/config/cfgs.py has corresponding NAME_LABEL_MAP in the /lib/label_name_dict and the key in the NAME_LABEL_MAP dict contains all object class in your own dataset.

powermano avatar Jun 07 '18 07:06 powermano

@powermano Thank you!i solved this problems! Ask, what is your version of tensorflow and python? My tensorflow is 1.1.0, python is 2.7, when I run train.py, the following problems occur:

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 84, in next_batch is_training=is_training) File "../data/io/read_tfrecord.py", line 58, 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'

I don't how to solve it?

lfdeep avatar Jun 07 '18 08:06 lfdeep

@lfdeep Refer to issues 13

yangxue0827 avatar Jun 07 '18 08:06 yangxue0827

@yangxue0827 ,There is another problem: 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)]]

lfdeep avatar Jun 07 '18 09:06 lfdeep