Giter Club home page Giter Club logo

Comments (3)

Ir1d avatar Ir1d commented on June 20, 2024 1

output = torch.prod(pow1[:-1] * pow2[-1])
I meet NaN during training on this line.
pytorch module tells me that Function 'ProdBackward0' returned nan values in its 0th output.
I've set normalize=True in the code, but nan still happens.
After changing to output = torch.prod(pow1[:-1]) * pow2[-1]
it turned out to Function 'MulBackward0' returned nan values in its 1th output.

from pytorch-msssim.

XiaotianM avatar XiaotianM commented on June 20, 2024

Hi, I find the official implement in tensorflow. The implementation is similar with this author's.
https://github.com/tensorflow/tensorflow/blob/r1.14/tensorflow/python/ops/image_ops_impl.py#L3143-L3267

from pytorch-msssim.

jorge-pessoa avatar jorge-pessoa commented on June 20, 2024

Hello,
I apologize for the delay in answering your question. As I understand from the official implementation, the product method (which is what is implemented in this repository) requires the multiplication of each value of the mcs array by the ssim of the last iteration of the SSIM calculation. See line 99 of msssim.m from https://ece.uwaterloo.ca/~z70wang/research/iwssim/ :

overall_mssim = prod(mcs_array(1:level-1).^weight(1:level-1))*(mssim_array(level).^weight(level));

Regarding your stability issues, I will be merging a different approach to ensure stability in the initial iterations which may help you (if you're still interested).

Thank you for your contributions. I will be closing this issue for now due to its age. If you still have any questions feel free to open a new one.

from pytorch-msssim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.