nv-tlabs / GSCNN

Gated-Shape CNN for Semantic Segmentation (ICCV 2019)
https://nv-tlabs.github.io/GSCNN/
Other
915 stars 200 forks source link

Evaluation code bug #7

Closed ShreyasSkandanS closed 4 years ago

ShreyasSkandanS commented 4 years ago

In train.py,

on line 139

if args.evaluate:
        # Early evaluation for benchmarking
        validate(val_loader, net, criterion_val,
                 optim, epoch, writer)
        evaluate(val_loader, net)
        return

The variable 'epoch' is used before being defined. I was able to work my way around this by just passing 0 or 1 in place of epoch, since for pure evaluation purposes this is irrelevant.

if args.evaluate:
        # Early evaluation for benchmarking
        validate(val_loader, net, criterion_val,
                 optim, 1, writer)
        evaluate(val_loader, net)
        return

Maybe this is worth looking into.

Best regards, Shreyas

Tetsujinfr commented 4 years ago

I was about to log the same issue, you saved my day with this temp workaround. tx a lot.

tovacinni commented 4 years ago

Yes, this is a bug. Fixed as per https://github.com/nv-tlabs/GSCNN/pull/9

Thanks @ShreyasSkandanS for the pull request!