0

I am trying to run balloon.py from https://github.com/matterport/Mask_RCNN on Pycharm, using tensorflow 2.11 and python 3.8. I have been able to make changes to model.py to accomodate tensorflow 2.11. Now, when I try to run balloons.py from Pycharm, the issue I am running into is this:

usage: balloon.py [-h] [--dataset /path/to/balloon/dataset/] --weights
              /path/to/weights.h5 [--logs /path/to/logs/]
              [--image path or URL to image]
              [--video path or URL to video]
              <command>
balloon.py: error: the following arguments are required: <command>, --weights

I think the error stems from this section of balloons.py:

if __name__ == '__main__':
import argparse

# Parse command line arguments
parser = argparse.ArgumentParser(
    description='Train Mask R-CNN to detect balloons.')
parser.add_argument("command",
                    metavar="<command>",
                    help="'train' or 'splash'")
parser.add_argument('--dataset', required=False,
                    metavar="/path/to/balloon/dataset/",
                    help='Directory of the Balloon dataset')
parser.add_argument('--weights', required=True,
                    metavar="/path/to/weights.h5",
                    help="Path to weights .h5 file or 'coco'")
parser.add_argument('--logs', required=False,
                    default=DEFAULT_LOGS_DIR,
                    metavar="/path/to/logs/",
                    help='Logs and checkpoints directory (default=logs/)')
parser.add_argument('--image', required=False,
                    metavar="path or URL to image",
                    help='Image to apply the color splash effect on')
parser.add_argument('--video', required=False,
                    metavar="path or URL to video",
                    help='Video to apply the color splash effect on')
args = parser.parse_args()

I am not sure how to correct this.

The only modification I've made to this project is changing the root directory to where I'm storing this project.

Rina Tse
  • 61
  • 5

0 Answers0