DevoLearn / devolearn

Accelerate data driven research on embryos with deep learning models :microscope:
MIT License
43 stars 30 forks source link

Fix test fail: Due to recompute_scale_factor missing in UpsamplingBilinear2d #68

Closed kingjuno closed 2 years ago

kingjuno commented 2 years ago

There are issues in using UpsamplingBilinear2d for torch version >= 1.9.0 [ref]

One possible solution is to edit ..site-packages\torch\nn\modules:

def forward(self, input: Tensor) -> Tensor:
    return F.interpolate(input, self.size, self.scale_factor, self.mode, self.align_corners,
                         #recompute_scale_factor=self.recompute_scale_factor
                         )

But this isn't possible in this case. So this PR is to manually set recompute_scale_factor.

codecov-commenter commented 2 years ago

Codecov Report

Merging #68 (c23e4da) into master (d5baccc) will increase coverage by 0.06%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master      #68      +/-   ##
==========================================
+ Coverage   86.15%   86.22%   +0.06%     
==========================================
  Files          12       12              
  Lines         419      421       +2     
==========================================
+ Hits          361      363       +2     
  Misses         58       58              
Impacted Files Coverage Δ
...cell_membrane_segmentor/cell_membrane_segmentor.py 87.17% <100.00%> (+0.11%) :arrow_up:
...n/cell_nucleus_segmentor/cell_nucleus_segmentor.py 89.28% <100.00%> (+0.19%) :arrow_up:

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 904f454...c23e4da. Read the comment docs.

Mayukhdeb commented 2 years ago

Thanks @kingjuno for the PR ^^ I've left a comment in one of the diffs, please take a look.

Mayukhdeb commented 2 years ago

Thanks @kingjuno again for the PR!