Tramac / Lightweight-Segmentation

Lightweight models for real-time semantic segmentation(include mobilenetv1-v3, shufflenetv1-v2, igcv3, efficientnet).
Apache License 2.0
356 stars 77 forks source link

TypeError: object of type 'COCOSegmentation' has no len() #9

Closed pandamax closed 5 years ago

pandamax commented 5 years ago

I have added mscoco.py from the project that you did suggest.

I guess the problem below arises because of the incompatibility between python's version and pycocotools. Is there any suggestion to modify the code? thanks in advance.

train set loading annotations into memory... Done (t=0.89s) creating index... index created! Traceback (most recent call last): File "train.py", line 291, in trainer = Trainer(args) File "train.py", line 106, in init args.iters_per_epoch = len(trainset) // (args.num_gpus * args.batch_size) TypeError: object of type 'COCOSegmentation' has no len()

Tramac commented 5 years ago

Please add function def __len__(self) in mscoco.py.