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: 'MyDataset' object has no attribute 'global_rank' #200

Closed
cahya-wirawan opened this issue Nov 15, 2023 · 3 comments
Closed

Comments

@cahya-wirawan
Copy link

Hi,

When I run the train.py script of RWKV-v5, I get error message AttributeError: 'MyDataset' object has no attribute 'global_rank' as follow:

AttributeError: Caught AttributeError in DataLoader worker process 0.
Original Traceback (most recent call last):
  File "/home/cahya/miniconda3/envs/rwkv/lib/python3.9/site-packages/torch/utils/data/_utils/worker.py", line 308, in _worker_loop
    data = fetcher.fetch(index)
  File "/home/cahya/miniconda3/envs/rwkv/lib/python3.9/site-packages/torch/utils/data/_utils/fetch.py", line 51, in fetch
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "/home/cahya/miniconda3/envs/rwkv/lib/python3.9/site-packages/torch/utils/data/_utils/fetch.py", line 51, in <listcomp>
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "/home/cahya/Work/RWKV-LM/RWKV-v5/src/dataset.py", line 104, in __getitem__
    rank = self.global_rank
AttributeError: 'MyDataset' object has no attribute 'global_rank'

my torch version is: 2.1.0.dev20230629

@cahya-wirawan
Copy link
Author

The problem was caused by the pytorch lightning version 2.1.1. After I downgraded to 1.9.5, the problem was solved.

@DarokCx
Copy link

DarokCx commented Dec 8, 2023

followed those instructions but now: argument of type 'NoneType' is not iterable happens

@BlinkDL
Copy link
Owner

BlinkDL commented Dec 8, 2023

@DarokCx IMPORTANT: Use deepspeed==0.7.0 pytorch-lightning==1.9.5 torch 1.13.1+cu117

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

3 participants