georgian-io / Multimodal-Toolkit

Multimodal model for text and tabular data with HuggingFace transformers as building block for text data
https://multimodal-toolkit.readthedocs.io
Apache License 2.0
587 stars 84 forks source link

wrong code #14

Closed SharonJin422 closed 1 year ago

SharonJin422 commented 2 years ago

when the config is set as follows, there is an error. image

File "main.py", line 167, in main if training_args.do_train: File "/Users/sharon/Library/Python/3.8/lib/python/site-packages/transformers/trainer.py", line 707, in train tr_loss += self.training_step(model, inputs) File "/Users/sharon/Library/Python/3.8/lib/python/site-packages/transformers/trainer.py", line 994, in training_step outputs = model(inputs) File "/Users/sharon/Library/Python/3.8/lib/python/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl return forward_call(*input, *kwargs) File "/Users/sharon/Desktop/Models/Multimodal-Toolkit-master/multimodal_transformers/model/tabular_transformers.py", line 419, in forward combined_feats = self.tabular_combiner(pooled_output, File "/Users/sharon/Library/Python/3.8/lib/python/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl return forward_call(input, kwargs) File "/Users/sharon/Desktop/Models/Multimodal-Toolkit-master/multimodal_transformers/model/tabular_combiner.py", line 408, in forward numerical_feats = self.num_mlp(numerical_feats) File "/Users/sharon/Library/Python/3.8/lib/python/site-packages/torch/nn/modules/module.py", line 1177, in getattr raise AttributeError("'{}' object has no attribute '{}'".format( AttributeError: 'TabularFeatCombiner' object has no attribute 'num_mlp'

I think there is a typo in file tabular_combiner.py:268, self.cat_mlp should be self.num_mlp image