lucidrains / vector-quantize-pytorch

Vector (and Scalar) Quantization, in Pytorch
MIT License
2.44k stars 197 forks source link

accelerate launch test.py error #112

Closed AmpleFiled closed 5 months ago

AmpleFiled commented 6 months ago

I can run the README code in a single GPU, but get error when i run the multi GPU distribution training Traceback (most recent call last): File "/vepfs/home/tianbo/sora/test.py", line 77, in trainer = VideoTokenizerTrainer( File "/usr/local/lib/python3.10/dist-packages/pytorch_custom_utils/accelerate_utils.py", line 95, in init _orig_init(self, *args, **kwargs) File "<@beartype(magvit2_pytorch.trainer.VideoTokenizerTrainer.init) at 0x7fa710968790>", line 314, in init File "/vepfs/home/tianbo/sora/magvit2_pytorch/trainer.py", line 202, in init self.has_multiscale_discrs = self.model.has_multiscale_discrs File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1688, in getattr raise AttributeError(f"'{type(self).name}' object has no attribute '{name}'") AttributeError: 'DistributedDataParallel' object has no attribute 'has_multiscale_discrs'

lucidrains commented 5 months ago

@AmpleFiled the issue is actually in the magvit2 repo, should be fixed