alexander-pv / maskrcnn_tf2

Mask R-CNN for object detection and instance segmentation with Keras and TensorFlow V2 and ONNX and TensorRT optimization support.
Other
40 stars 11 forks source link

AssertionError: assert len(annot_file) == 1 #19

Open TS-code-netizen opened 2 years ago

TS-code-netizen commented 2 years ago

I created a new python file using "./notebooks/example_data_loader_balloon.ipynb" and downloaded the balloon data and run on my anaconda virtual env using python test_data.py I get this error, can I know how should I solve it?

Traceback (most recent call last): File "test_data.py", line 21, in train_dataset = balloon.BalloonDataset(images_dir=train_dir, class_key='object', classes_dict=CONFIG['class_dict'], preprocess_transform=preprocess.get_input_preprocess(normalize=CONFIG['normalization']), augmentation=aug.get_training_augmentation(), json_annotation_key=None,**CONFIG) File "C:\Users\Tiffany\Desktop\working_project\Mask_rcnn\mask_rcnn\alexander_pv\maskrcnn_tf2\src\preprocess\preprocess.py", line 46, in init assert len(annot_file) == 1 AssertionError

I am using conda virtual environment based on this requirements_tf2.4.txt

my balloon dataset path base_dir: C:\Users\Tiffany\Desktop\working_project\Mask_rcnn\mask_rcnn\alexander_pv\maskrcnn_tf2\balloon train_dir: C:\Users\Tiffany\Desktop\working_project\Mask_rcnn\mask_rcnn\alexander_pv\maskrcnn_tf2\balloon\train val_dir: C:\Users\Tiffany\Desktop\working_project\Mask_rcnn\mask_rcnn\alexander_pv\maskrcnn_tf2\balloon\val

TS-code-netizen commented 2 years ago

Hi, I solve it, it is due to the missing "via_region_data" JSON file in the train datatset.