Skip to content

PerceptualLoss Bug #8412

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
CugAgo opened this issue Apr 6, 2025 · 4 comments
Open

PerceptualLoss Bug #8412

CugAgo opened this issue Apr 6, 2025 · 4 comments

Comments

@CugAgo
Copy link

CugAgo commented Apr 6, 2025

Describe the bug
When I use PerceptualLoss, if the loss is too low, it may occur "RuntimeError: Function ‘SqrtBackward0‘ returned nan values in its 0th output", I will provide the specific error location later.

Environment

MONAI version: 1.4.0
Numpy version: 1.26.4
Pytorch version: 2.4.0+cu118
MONAI flags: HAS_EXT = False, USE_COMPILED = False, USE_META_DICT = False
MONAI rev id: 46a5272
MONAI file: //miniconda3/envs/monai/lib/python3.10/site-packages/monai/init.py

Optional dependencies:
Pytorch Ignite version: NOT INSTALLED or UNKNOWN VERSION.
ITK version: NOT INSTALLED or UNKNOWN VERSION.
Nibabel version: NOT INSTALLED or UNKNOWN VERSION.
scikit-image version: NOT INSTALLED or UNKNOWN VERSION.
scipy version: 1.15.2
Pillow version: 11.1.0
Tensorboard version: 2.19.0
gdown version: NOT INSTALLED or UNKNOWN VERSION.
TorchVision version: 0.19.0+cu118
tqdm version: 4.67.1
lmdb version: NOT INSTALLED or UNKNOWN VERSION.
psutil version: 7.0.0
pandas version: NOT INSTALLED or UNKNOWN VERSION.
einops version: 0.8.1
transformers version: NOT INSTALLED or UNKNOWN VERSION.
mlflow version: NOT INSTALLED or UNKNOWN VERSION.
pynrrd version: NOT INSTALLED or UNKNOWN VERSION.
clearml version: NOT INSTALLED or UNKNOWN VERSION.

@cvbourne
Copy link

cvbourne commented Apr 7, 2025

Perhaps related to this issue? https://github.com/richzhang/PerceptualSimilarity/pull/139/files

@CugAgo Please provide an error location and if it's the same root cause, I'll submit a PRQ (if this is a 👍 issue for a first time contributor).

@CugAgo
Copy link
Author

CugAgo commented Apr 7, 2025

也许与此问题有关?https://github.com/richzhang/PerceptualSimilarity/pull/139/files

请提供错误位置,如果是相同的根本原因,我将提交 PRQ(如果这是👍第一次贡献者的问题)。

yes, I'm sorry for forgetting to provide accurate error information yesterday. In the normalize_tensor function, I think this bug can be fixed through this method, good job!

@cvbourne
Copy link

cvbourne commented Apr 7, 2025

Great. #8414

@CugAgo
Copy link
Author

CugAgo commented Apr 8, 2025

May I ask when this source code will be updated to the MONAI library? Can I update the corresponding version through pip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants