-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
cannot find neptune.new.utils with Neptune-client==0.16.3
#18555
Comments
@filipporemonato It looks like the |
Thanks Adrian! Yes that's what I thought too. It may work as a workaround for now, but as said Neptune-client comes from the customer's env, so I am not sure if it will be possible to change it and go over to Neptune. But it should be (bar some backward-compatibility issues).
I guess my post here was more about the strange fact that all goes smoothly as long as Neptune-client is not installed. It seems a bit weird that installing a package "breaks" the usage of Lightning, especially if Lightning can well be used without that package at all.
Thanks for the suggestion about Neptune though.
|
For now, you can either update to elif _NEPTUNE_CLIENT_AVAILABLE:
# <1.0 package structure
import neptune.new as neptune
from neptune.new import Run
from neptune.new.handler import Handler
from neptune.new.types import File
# from neptune.new.utils import stringify_unsupported Here's an upgrade guide to Neptune 1.0+: https://docs.neptune.ai/setup/neptune-client_1-0_release_changes/ |
@SiddhantSadangi What should be done here? Options:
Any other suggestions? |
@awaelchli - 1 would be the most viable option until we submit a fix to |
No @SiddhantSadangi I'm talking about the fix. These are the three options I see to fix it in the NeptuneLogger implementation in Lightning. So of these 3 options, which one do you want me to do? Or do you see another one? |
@awaelchli Hello! Let me share my experience. I met the same issue. The easiest solution is to do current versions in pip are: |
@ArtemSivtsov - that's the recommended solution, however sometimes users are constrained with the packages they can install, and that might prevent them from upgrading to |
@awaelchli - for the fix, I was thinking of introducing a _STRINGIFY_UNSUPPORTED_AVAILABLE = True
...
elif _NEPTUNE_CLIENT_AVAILABLE:
...
# Needed for neptune-client<0.16.16
try:
from neptune.new.utils import stringify_unsupported
except ModuleNotFoundError:
_STRINGIFY_UNSUPPORTED_AVAILABLE = False
...
def log_hyperparams(self, params: Union[Dict[str, Any], Namespace]) -> None: # type: ignore[override]
...
if _STRINGIFY_UNSUPPORTED_AVAILABLE:
self.run[parameters_key] = stringify_unsupported(params)
else:
self.run[parameters_key] = params
Full file attached as I can push a PR if this works for you. |
Neptune-client==0.16.3
We've introduced There is no need to use Let me prepare the PR that will mostly follow the suggestions from @SiddhantSadangi so the support for |
@awaelchli Yes. It closes in with a meaning that it won't be supported anymore. |
Bug description
Pytorch Lightning 2.0.8 -
import pytorch_lightning as pl
fails with error messageNo module named 'neptune.new.utils'
, but I have Neptune-client 0.16.3. More interestingly, the code runs perfectly on an env that does not even have neptune-client installed.I have reproduced on a clean environment (see steps below), and I was able to import Lightning up until the point where I installed Neptune-client. Then, the import fails with the error message presented here.
My problem is that I need to use Lightning in an env a customer provided us, which uses Neptune-client as indicated, and I am therefore unsure on whether we can remove/change that package.
This is on Python 3.10.12.
Error traceback:
What version are you seeing the problem on?
v2.0
How to reproduce the bug
Create new environment
Install Pytorch 1.11.0
Install Pytorch Geometric (the one for Pytorch 1.11)
Install Pytorch Lightning (note that lightning 2.0 is compatible with Pytorch 1.11, see compatibility matrix https://lightning.ai/docs/pytorch/stable/versioning.html)
Install neptune-client 0.16.3
Try importing Pytorch Lightning
Obtain error message above.
#- Lightning Component (e.g. Trainer, LightningModule, LightningApp, LightningWork, LightningFlow):
#- PyTorch Lightning Version: 2.0.8
#- PyTorch Version: 1.11.0
#- Python version: 3.10.12
#- OS: McOS Ventura 13.4.1
The text was updated successfully, but these errors were encountered: