yilundu / irem_code_release

ICML 2022: Learning Iterative Reasoning through Energy Minimization
https://energy-based-model.github.io/iterative-reasoning-as-energy-minimization/
MIT License
42 stars 6 forks source link

error with multiple GPUs #2

Closed LiewFeng closed 2 years ago

LiewFeng commented 2 years ago

Thank you for your code! I can run it successfully with one GPU. But when I ran the code with multiple GPUs, I got the following error:

Traceback (most recent call last): File "/opt/conda/lib/python3.8/site-packages/torch/multiprocessing/spawn.py", line 59, in _wrap fn(i, *args) File "/3dod2/Workspace/irem_code_release/train.py", line 690, in main_single sync_model(model) File "/3dod2/Workspace/irem_code_release/train.py", line 305, in sync_model for model in model: TypeError: 'EBM' object is not iterable

Any suggestions? Thanks!

yilundu commented 2 years ago

Hi,

I pushed an update -- does it work? I unfortunately have not tested the multigpu training code in a long time, so its a bit outdated

LiewFeng commented 2 years ago

It works now. Thanks for your quick reply!