question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Warning: Moving average ignored a value of inf

See original GitHub issue

Hi, im try to train yolact to detect cars with images from COCO. I take all of the images with cars in it and make dataset from them. My config look like this: ` only_cars_coco2017_dataset = dataset_base.copy({ ‘name’: ‘cars COCO 2017’,

# Training images and annotations
'train_info': '/home/ws/data/COCO/only_cars_train.json',
'train_images':   '/home/ws/data/COCO/train/train2017/',

# Validation images and annotations.
'valid_info': '/home/ws/data/COCO/only_cars_val.json',
'valid_images':   '/home/ws/data/COCO/val/val2017/',

'class_names': ('car'),
'label_map': {1: 1}

})

yolact_im200_coco_cars_config = yolact_base_config.copy({ ‘name’: ‘yolact_im200_coco_cars’,

# Dataset stuff
'dataset': only_cars_coco2017_dataset,
'num_classes': len(only_cars_coco2017_dataset.class_names) + 1,

'masks_to_train': 20,
'max_num_detections': 20,
'max_size': 200,
'backbone': yolact_base_config.backbone.copy({
    'pred_scales': [[int(x[0] / yolact_base_config.max_size * 200)] for x in yolact_base_config.backbone.pred_scales],
}),

}) `

After a few iterations, my loss going very high…

Can somwone help me with this?

Update: Also if im train with full COCO dataset i get the same error…

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:60

github_iconTop GitHub Comments

1reaction
Rm1n90commented, May 28, 2020

@jasonkena, Thanks, Eval now working with AMP.

1reaction
jasonkenacommented, May 28, 2020

Sorry @Auth0rM0rgan, I believe you were right. I did not initialize amp within eval.py, which is why the problem only showed up during inference.

@Rm1n90, to fix it I believe you have to add

if args.cuda:
    net = net.cuda()
if cfg.use_amp:
    from apex import amp

    if not args.cuda:
        raise ValueError("amp must be used with CUDA")
    net = amp.initialize(net, opt_level="O1")

before net = CustomDataParallel(net).cuda() (https://github.com/jasonkena/yolact/blob/e1a949445dc0c57eb7c8f10470630faff0ce22e2/eval.py#L913)

I haven’t tested it, can you tell me how it turns out?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Training Crash (Warning: Moving average ignored a value of ...
Training Crash (Warning: Moving average ignored a value of nan/inf && /pytorch/aten/src/ATen/native/cuda/Loss.cu:102: operator(): block: [155,0, ...
Read more >
Moving Averages - Simple and Exponential - ChartSchool
A rising moving average shows that prices are generally increasing. A falling moving average indicates that prices, on average, are falling.
Read more >
If You Want To Time The Market, Ignore Moving Averages
If a market or security is above key moving averages, it's perceived to indicate a healthy bullish trend. Conversely, when key moving averages ......
Read more >
Moving Average Price is Zero,during MIRO - SAP Community
after this i am also getting after the above the warning message immediately. goods receipt document 50002875 0001 already selected. both are ...
Read more >
Using Amazon CloudWatch alarms - AWS Documentation
The alarm performs one or more actions based on the value of the metric or ... Alarms that evaluate metrics in the AWS/DynamoDB...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found