megvii-research / MSPN

Multi-Stage Pose Network

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AttributeError: 'Engine' object has no attribute 'local_rank'

pypancho opened this issue · comments

commented

When running 'python3 -m torch.distributed.launch --nproc_per_node=1 train.py', I got the following issue:

Traceback (most recent call last):
File "train.py", line 119, in
main()
File "train.py", line 87, in main
if engine.local_rank == 0:
AttributeError: 'Engine' object has no attribute 'local_rank'

I noticed that in the folder 'cvpack/torch_modeling/engine', there exists the engine.py.
Line 87: if engine.local_rank == 0:
The error happened in the line 87.

Could I know how to fix this issue? Thank you very much.

commented

Solved.

In the engine.py, the issue is because self.distributed is False in line 56.

Thus, please add 'self.local_rank = self.args.local_rank' in line 55.