Skip to content
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

ImportError: cannot import name 'EarlyStopping' from 'pytorchtools' #15

Open
HripsimeS opened this issue Apr 11, 2022 · 9 comments
Open

Comments

@HripsimeS
Copy link

Hello @Bjarten

I am trying to use your approach for the early stopping. I installed pytorchtools by using "pip install pytorchtools"
Then I wanted to import EarlyStopping using "from pytorchtools import EarlyStopping", but eventually I received the following error:

ImportError: cannot import name 'EarlyStopping' from 'pytorchtools' (C:\Users\Name\anaconda3\envs\abys\lib\site-packages\pytorchtools_init_.py)

Can you please let me know why I am receiving this error and how to fix it potentially? Thank you in advance!

@Bjarten
Copy link
Owner

Bjarten commented Apr 15, 2022 via email

@HripsimeS
Copy link
Author

HripsimeS commented Apr 19, 2022

@Bjarten thanks for your reply! I downloaded the project and installed the dependencies using pip install -r requirements.txt.
But when I do "from pytorchtools import EarlyStopping", it gives me this error
ImportError: cannot import name 'EarlyStopping' from 'pytorchtools' (C:\Users\Hripsime\anaconda3\envs\abys\lib\site-packages\pytorchtools_init_.py)

Can you please let me know how to fix this issue to make it work eventually. Thanks in advance!

@Bjarten
Copy link
Owner

Bjarten commented Apr 19, 2022 via email

@Bjarten
Copy link
Owner

Bjarten commented Apr 19, 2022 via email

@HripsimeS
Copy link
Author

@Bjarten thanks a lot, it worked eventually when I moved pytorchtools.py file to the corresponding folder 👍 🥇

@Bjarten
Copy link
Owner

Bjarten commented Apr 19, 2022 via email

@HripsimeS
Copy link
Author

HripsimeS commented Apr 20, 2022

Hello @Bjarten. Thanks for creating a nice EarlyStopping. It worked fine with my model, but I got a bit strange outcome "nan" values at some point and could not figure out why. Any ideas why I could get those "nan" values? Thanks in advance :)

NAN_value

@Bjarten
Copy link
Owner

Bjarten commented Apr 20, 2022 via email

@Bjarten
Copy link
Owner

Bjarten commented Oct 11, 2022 via email

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