thunlp / Chinese_NRE

Source code for ACL 2019 paper "Chinese Relation Extraction with Multi-Grained Information and External Linguistic Knowledge"
MIT License
269 stars 43 forks source link

File "Chinese_NRE\nn\mglattice.py", line 175, in reset_parameters self.weight_hh.data.set_(weight_hh_data) RuntimeError: set_storage is not allowed on a Tensor created from .data or .detach(). If your intent is to change the metadata of a Tensor (such as sizes / strides / storage / storage_offset) without autograd tracking the change, remove the .data / .detach() call and wrap the change in a `with torch.no_grad():` block. #20

Closed mzhadigerov closed 3 years ago

mzhadigerov commented 3 years ago

Changing
self.weighthh.data.set(weight_hh_data)

to with torch.no_grad(): self.weighthh.data.set(weight_hh_data)

did not help.

siyu1992 commented 3 years ago

did you solve this problem? can you share your solution plz? thx

mzhadigerov commented 3 years ago

@siyu1992 No. I ended up not using this model

siyu1992 commented 3 years ago

@mzhadigerov Okay.... thx anyway