Zhengxinyang / LAS-Diffusion

MIT License
217 stars 15 forks source link

pytorch-lightning "could not infer the batch_size" #4

Closed yhhxt closed 1 year ago

yhhxt commented 1 year ago

Hello, I encountered an error with pytorch-lightning while using train_sketch.sh. When searching for a solution to this error, I noticed that you also encountered a similar issue. I made changes to the code in the identified dataloader section and specified the batch size, but the problem still persists. How did you solve this problem? image

Zhengxinyang commented 1 year ago

What is your version of pytorch-lightning? One way to solve this problem is to remove track_grad_norm=2 in Trainer

yhhxt commented 1 year ago

Thank you very much for your quick response. Initially, I was using pytorch-lightning version 1.6.2. I tried upgrading to version 1.7.5, but I still encountered an error. Now, following your advice, I removed the line "track_grad_norm=2", and it is running smoothly without any issues. Thanks