icevision icon indicating copy to clipboard operation
icevision copied to clipboard

Remove manual `torch.no_grad` and train eval mode in LightningModule

Open aniketmaurya opened this issue 3 years ago • 2 comments

PL LightningModule automatically sets train and eval mode and torch.no_grad during the training and validation steps.

aniketmaurya avatar May 16 '22 11:05 aniketmaurya

Codecov Report

Merging #1100 (13bb3e7) into master (743cb7d) will increase coverage by 0.00%. The diff coverage is 80.00%.

@@           Coverage Diff           @@
##           master    #1100   +/-   ##
=======================================
  Coverage   85.43%   85.44%           
=======================================
  Files         301      301           
  Lines        6600     6594    -6     
=======================================
- Hits         5639     5634    -5     
+ Misses        961      960    -1     
Flag Coverage Δ
unittests 85.44% <80.00%> (+<0.01%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...odels/ross/efficientdet/lightning/model_adapter.py 37.93% <0.00%> (+1.26%) :arrow_up:
icevision/models/mmdet/lightning/model_adapter.py 96.96% <100.00%> (-0.26%) :arrow_down:
...sion/models/torchvision/lightning_model_adapter.py 100.00% <100.00%> (ø)
...dels/ultralytics/yolov5/lightning/model_adapter.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 743cb7d...13bb3e7. Read the comment docs.

codecov[bot] avatar May 16 '22 15:05 codecov[bot]

Any idea why black formatting check might failing here?

potipot avatar May 17 '22 09:05 potipot