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

Error while running the training script. #12

Open
LarrySil opened this issue Jul 26, 2024 · 3 comments
Open

Error while running the training script. #12

LarrySil opened this issue Jul 26, 2024 · 3 comments

Comments

@LarrySil
Copy link

LarrySil commented Jul 26, 2024

Hi,
I get an error like this when trying to run the training:

  • Traceback (most recent call last):
  • File "c:\TreeCrownDelineation\TreeCrownDelineation\examples\training_example.py", line 88, in
  • trainer.fit(model, data)
    
  • File "C:\Users\samul\Anaconda\envs\TCD\Lib\site-packages\pytorch_lightning\trainer\trainer.py", line 543, in fit
  • call._call_and_handle_interrupt(
    
  • File "C:\Users\samul\Anaconda\envs\TCD\Lib\site-packages\pytorch_lightning\trainer\call.py", line 44, in _call_and_handle_interrupt
  • return trainer_fn(*args, **kwargs)
    
  •        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    
  • File "C:\Users\samul\Anaconda\envs\TCD\Lib\site-packages\pytorch_lightning\trainer\trainer.py", line 579, in _fit_impl
  • self._run(model, ckpt_path=ckpt_path)
    
  • File "C:\Users\samul\Anaconda\envs\TCD\Lib\site-packages\pytorch_lightning\trainer\trainer.py", line 948, in _run
  • call._call_setup_hook(self)  # allow user to set up LightningModule in accelerator environment
    
  • ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    
  • File "C:\Users\samul\Anaconda\envs\TCD\Lib\site-packages\pytorch_lightning\trainer\call.py", line 94, in _call_setup_hook
  • _call_lightning_datamodule_hook(trainer, "setup", stage=fn)
    
  • File "C:\Users\samul\Anaconda\envs\TCD\Lib\site-packages\pytorch_lightning\trainer\call.py", line 181, in _call_lightning_datamodule_hook
  • return fn(*args, **kwargs)
    
  •        ^^^^^^^^^^^^^^^^^^^
    
  • TypeError: InMemoryDataModule.setup() got an unexpected keyword argument 'stage'

Tried adding the "stage" argument to the setup function, but this does not seem to fix the issue.

@maxfreu
Copy link
Contributor

maxfreu commented Jul 26, 2024

Should be fixed now, please try again. Also, you can format code into code blocks by using triple backticks ``` before and after the code or error message.

@LarrySil
Copy link
Author

This still seems to get the same error as above, even with the stage = None added to the setup. Could this be an issue with the pytorch version? I'm running 2.4.0

@maxfreu
Copy link
Contributor

maxfreu commented Jul 30, 2024

Stupid question, but are you sure that you are running the updated code? You can run your code in a debugger (e.g. in pycharm) to see which code is called and why it fails.

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