Bjarten / early-stopping-pytorch

Early stopping for PyTorch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

HripsimeS opened this issue · comments

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 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 thanks a lot, it worked eventually when I moved pytorchtools.py file to the corresponding folder 👍 🥇

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