yangxue0827 / FPN_Tensorflow

A Tensorflow implementation of FPN detection framework.
415 stars 150 forks source link

convert_data_to_tfrecord.py error! #20

Open lfdeep opened 6 years ago

lfdeep commented 6 years ago

****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

powermano commented 6 years ago

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.

lfdeep commented 6 years ago

@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?

yangxue0827 commented 6 years ago

@lfdeep Refer to issues 13

lfdeep commented 6 years ago

@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)]]