xplip / pixel

Research code for pixel-based encoders of language (PIXEL)
https://arxiv.org/abs/2207.06991
Apache License 2.0
332 stars 33 forks source link

Dependency parsing error: AttributeError: 'DataParallel' object has no attribute 'config' #12

Closed amunozo closed 1 year ago

amunozo commented 1 year ago

Hi,

I succesfully configured the repository and everything works fine, except for dependency parsing. When trying to either run the sanity check or train a new model, I get this error: Traceback (most recent call last): File "/home/lys/pixel_mainlp/pixel/scripts/training/run_ud.py", line 466, in <module> main() File "/home/lys/pixel_mainlp/pixel/scripts/training/run_ud.py", line 423, in main outputs = trainer.predict(test_dataset=eval_dataset, metric_key_prefix="eval") File "/home/lys/anaconda3/envs/pixel-env/lib/python3.9/site-packages/transformers/trainer.py", line 2331, in predict output = eval_loop( File "/home/lys/pixel_mainlp/pixel/src/pixel/trainer.py", line 179, in evaluation_loop mask = arc_labels.ne(model.config.pad_token_id) File "/home/lys/anaconda3/envs/pixel-env/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1614, in __getattr__ raise AttributeError("'{}' object has no attribute '{}'".format( AttributeError: 'DataParallel' object has no attribute 'config' I am using PyTorch 2.0.1 with CUDA 11.7. I managed to install it with the cuda 11.3 version suggested on the repository, and it works, but it installs the CPU PyTorch version instead of the GPU one. I do not know how to fix both things at the same time. Thanks.