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

AttributeError: 'DataLoader' object has no attribute 'reset_workers' #65

Open
wzr0108 opened this issue Feb 6, 2023 · 1 comment
Open

Comments

@wzr0108
Copy link

wzr0108 commented Feb 6, 2023

I run "xfuse run my-config.toml --save-path my-run" in cmd, everything is fine.
When I run this python file in debug mode,and my args is "run myconfig.toml --save-path my-run"

import re
import sys
from xfuse.__main__ import cli
if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
    sys.exit(cli())

I got this error

Traceback (most recent call last):
  File "D:\xfuse\xfuse\__main__.py", line 585, in run
    _run(
  File "D:\xfuse\xfuse\run.py", line 149, in run
    with Session(
  File "D:\xfuse\xfuse\session\session.py", line 45, in __enter__
    _apply_session(get_session())
  File "D:\xfuse\xfuse\session\session.py", line 85, in _apply_session
    setter(getattr(session, name, default))
  File "D:\xfuse\xfuse\session\items\genes.py", line 10, in _set_genes
    dataloader.reset_workers()
AttributeError: 'DataLoader' object has no attribute 'reset_workers'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "D:\xfuse\xfuse\__main__.py", line 585, in run
    _run(
  File "D:\xfuse\xfuse\session\session.py", line 64, in __exit__
    assert self == _SESSION_STACK.pop()
AssertionError

I want to read the code in debug mode, how to solve this problem?

@ludvb
Copy link
Owner

ludvb commented Mar 30, 2023

Thank you for this report! Can you tell me which IDE this is? It's very difficult to tell what could be going wrong. As a guess, maybe the debug mode failed to resolve a naming conflict, causing a mixup of classes. If that is the case, you can maybe try renaming the DataLoader class in xfuse/data/utility/misc.py to something else. This is very much a shot in the dark, though, and probably won't help. Let us know if you figure anything out.

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