From cbe0b2cd26b04680237e40988bc954a0cc3194af Mon Sep 17 00:00:00 2001 From: jh Date: Fri, 23 Apr 2021 20:53:54 -0700 Subject: [PATCH 1/2] Adds version check for ssim_multiscale --- core/leras/layers/MsSsim.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/leras/layers/MsSsim.py b/core/leras/layers/MsSsim.py index d45a599..03b9a14 100644 --- a/core/leras/layers/MsSsim.py +++ b/core/leras/layers/MsSsim.py @@ -21,7 +21,11 @@ class MsSsim(nn.LayerBase): y_true_t = tf.transpose(tf.cast(y_true, tf.float32), [0, 2, 3, 1]) y_pred_t = tf.transpose(tf.cast(y_pred, tf.float32), [0, 2, 3, 1]) - ms_ssim_val = tf.image.ssim_multiscale(y_true_t, y_pred_t, max_val, power_factors=self.power_factors, filter_size=self.kernel_size) + if tf.__version__ >= "1.14": + ms_ssim_val = tf.image.ssim_multiscale(y_true_t, y_pred_t, max_val, power_factors=self.power_factors, filter_size=self.kernel_size) + else: + ms_ssim_val = tf.image.ssim_multiscale(y_true_t, y_pred_t, max_val, power_factors=self.power_factors) + # ssim_multiscale returns values in range [0, 1] (where 1 is completely identical) # subtract from 1 to get loss return 1.0 - ms_ssim_val From b3200179594915e3785817eb0261a8d0ebe1964e Mon Sep 17 00:00:00 2001 From: jh Date: Fri, 23 Apr 2021 21:01:41 -0700 Subject: [PATCH 2/2] update changelog --- CHANGELOG.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e964de..deb13df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,9 +4,9 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased] -### In Progress -- [Freezeable layers (encoder/decoder/etc.)](https://github.com/faceshiftlabs/DeepFaceLab/tree/feature/freezable-weights) +## [1.5.1] - 2020-04-23 +### Fixed +- Fixes bug with MS-SSIM when using a version of tensorflow < 1.14 ## [1.5.0] - 2020-03-29 ### Changed @@ -80,7 +80,7 @@ This should help with rough areas directly next to the mask - Reset stale master branch to [seranus/DeepFaceLab](https://github.com/seranus/DeepFaceLab), 21 commits ahead of [iperov/DeepFaceLab](https://github.com/iperov/DeepFaceLab) ([compare](https://github.com/iperov/DeepFaceLab/compare/4818183...seranus:3f5ae05)) -[Unreleased]: https://github.com/faceshiftlabs/DeepFaceLab/compare/v1.5.0...HEAD +[1.5.1]: https://github.com/faceshiftlabs/DeepFaceLab/compare/v1.5.0...v1.5.1 [1.5.0]: https://github.com/faceshiftlabs/DeepFaceLab/compare/v1.4.2...v1.5.0 [1.4.2]: https://github.com/faceshiftlabs/DeepFaceLab/compare/v1.4.1...v1.4.2 [1.4.1]: https://github.com/faceshiftlabs/DeepFaceLab/compare/v1.4.0...v1.4.1