# PhysicsInformer not computing loss value

**URL:** <https://forums.developer.nvidia.com/t/physicsinformer-not-computing-loss-value/319297>\
**Category:** Technical Support (PhysicsNeMo Only)\
**Created:** [January 8, 2025, 5:37pm UTC](https://forums.developer.nvidia.com/t/physicsinformer-not-computing-loss-value/319297 "2025-01-08T17:37:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![krel](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@krel](https://forums.developer.nvidia.com/u/krel)\
**Post date:** [January 8, 2025, 5:37pm UTC](https://forums.developer.nvidia.com/t/physicsinformer-not-computing-loss-value/319297/1 "2025-01-08T17:37:19Z")

</div>

Dear experts,

I am trying to calculate the loss value of continuity equation using the loss function defined in [modulus/examples/cfd/stokes\_mgn/pi\_fine\_tuning.py at main · NVIDIA/modulus · GitHub](https://github.com/NVIDIA/modulus/blob/main/examples/cfd/stokes_mgn/pi_fine_tuning.py), which is using PhysicsInformer from modulus.sym.eq.phy\_informer. I intend to use this continuity loss as the loss function in my neural network model.

pi\_fine\_tuning.py is working as desired and calculated continuity loss with no problem. However, when I am testing it in a separate script (attached) the PhysicsInformer (grad\_method = ‘autodiff’) always returns value zero no matter what input I give, while there was no error raised. Although the example in phy\_inform.py works with no problem

 ![image_2025-01-08_173400957](https://global.discourse-cdn.com/nvidia/original/4X/f/3/d/f3dc94d9e7b31ce8199b506b87c0c31be6535626.png)

I am using the latest version of modulus.sym, Python 3.10 and CUDA 11.7  
[test.txt](https://forums.developer.nvidia.com/uploads/short-url/rAaFshFsK65bAgoWrQ1KszPt6HJ.txt) (583 Bytes)

Many thanks
