megvii-research / MSPN

Multi-Stage Pose Network
334 stars 63 forks source link

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

Closed pypancho closed 4 years ago

pypancho commented 4 years ago

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.

pypancho commented 4 years ago

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.