aclex / detection-experiments

Playground of various object detection models implemented in PyTorch
Apache License 2.0
7 stars 2 forks source link

Unable to run Training #3

Closed anujdutt9 closed 3 years ago

anujdutt9 commented 3 years ago

Hi. Thanks for a great framework. I am trying to run the basic Training using the command you have provided in the Readme file, but that command does not work for me. I am trying to train a model using COCO 2017 dataset. The command I used is this:

python train.py --dataset-style=coco --dataset /mnt/dataset/vision/COCO --train-image-set=train2017 --val-image-set=val2017 --net mb3-small-ssd-lite --scheduler cosine-wr --lr 0.01 --t0 5 --num-epochs 5

The error I am getting is this:

Traceback (most recent call last):
  File "/home/adutt/Downloads/Experiments/detection-experiments/arch/core_settings.py", line 9, in json_from_file_or_string
    return json.loads(config)
  File "/home/adutt/miniconda3/envs/anuj/lib/python3.8/json/__init__.py", line 357, in loads
    return _default_decoder.decode(s)
  File "/home/adutt/miniconda3/envs/anuj/lib/python3.8/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/home/adutt/miniconda3/envs/anuj/lib/python3.8/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "train.py", line 360, in <module>
    main()
  File "train.py", line 206, in main
    arch = get_arch(args.net_config)
  File "/home/adutt/Downloads/Experiments/detection-experiments/arch/bootstrap.py", line 23, in get_arch
    name = get_arch_name(config)
  File "/home/adutt/Downloads/Experiments/detection-experiments/arch/bootstrap.py", line 17, in get_arch_name
    settings = json_from_file_or_string(config)
  File "/home/adutt/Downloads/Experiments/detection-experiments/arch/core_settings.py", line 11, in json_from_file_or_string
    with open(config, 'r') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'mb3-small-ssd-lite'

Is there a model that I need to download from somewhere? I tried providing the path to json file under preset folder, but even that doesn't work. Can someone please help me out here? Thanks.

aclex commented 3 years ago

@anujdutt9 thanks for your interest to this project! Also thanks for pointing out, I seem to overlooked this command in README and didn't update it in time. You may use --net-config key instead of --net and specify any of presets in preset subdirectory to define the network architecture.

anujdutt9 commented 3 years ago

Hi @aclex I did try that. I got another error after that, specifically at this line: from timm.models.efficientnet_blocks import resolve_bn_args in tinynet.py. It looks like timm does not has this module anymore. So, either replace this with the latest implementation of timm or what I did for now is to just comment out this line: from backbone.tinynet import TinyNet in parse.py.

aclex commented 3 years ago

@anujdutt9 yes, that's a known failure, will fix it now as well.