Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'ContrastiveSlotNamePredictor' object has no attribute 'smoothLoss' #4

Open
rollben opened this issue May 22, 2022 · 0 comments

Comments

@rollben
Copy link

rollben commented May 22, 2022

I set use_contrastive_slotname_predictor: True and use_final_predictor: False, and run the script " python slu_main_debug.py --exp_name pclc --exp_id ap_0 --bidirection --freeze_emb --tgt_dm AddToPlaylist --n_samples 0 --tr --emb_file ./data/snips/emb/slu_word_char_embs_with_slotembs.npy"
however, the code error occurred,
File "E:\Project\joint_inent_slot\zero-shot\pcslot\src\slu\trainer_debug.py", line 67, in train_step
loss_slotname, slot_contrastive_loss= self.slotname_predictor(y_dm, lstm_hiddens, binary_golds=y_bin, final_golds=y_final)
File "D:\miniconda3\lib\site-packages\torch\nn\modules\module.py", line 1102, in _call_impl
return forward_call(*input, **kwargs)
File "E:\Project\joint_inent_slot\zero-shot\pcslot\src\slu\model_debug.py", line 498, in forward
loss_slotname += self.smoothLoss(pred_slotname_each_sample, gold_slotname_each_sample)
File "D:\miniconda3\lib\site-packages\torch\nn\modules\module.py", line 1177, in getattr
raise AttributeError("'{}' object has no attribute '{}'".format(
AttributeError: 'ContrastiveSlotNamePredictor' object has no attribute 'smoothLoss'

Does any wrong with the setting of code? Appreciated for responsed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant