Hanjun-Dai / pytorch_structure2vec

pytorch implementation of structure2vec (https://arxiv.org/abs/1603.05629)
MIT License
305 stars 76 forks source link

AttributeError: type object 'object' has no attribute '__getattr__' #3

Closed xjtuncy closed 6 years ago

xjtuncy commented 6 years ago

Dear author, I want to know the version of the pytorch you used. I am using torch-0.1.11.post5-cp27-none-linux_x86_64. But when I ran: python main.py -gm mean_field -saved_model saved/mean_field.model -phase test -mode cpu Some error occurred, and I think it was caused by different versions of pytorch.

Thanks!

‘’ ====== begin of s2v configuration ====== | msg_average = 0 ====== end of s2v configuration ====== loading data train: 1900000 valid: 82601 test: 220289 Traceback (most recent call last): File "main.py", line 111, in regressor = Regressor() File "main.py", line 92, in init max_lv=cmd_args.max_lv) File "/home/xjtuncy/lab/pytorch_structure2vecLab/pytorch_structure2vec-master/harvard_cep/../s2v_lib/embedding.py", line 35, in init weights_init(self) File "/home/xjtuncy/lab/pytorch_structure2vecLab/pytorch_structure2vec-master/harvard_cep/../s2v_lib/pytorch_util.py", line 46, in weights_init for name, p in m.named_parameters(): File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py", line 237, in getattr return object.getattr(self, name) AttributeError: type object 'object' has no attribute 'getattr' ‘’

Hanjun-Dai commented 6 years ago

Hi there,

I'm using torch-0.3.0.post4. Could you please try this version and let me know if it works.

xjtuncy commented 6 years ago

Now,I'm using torch-0.3.0.post4 and it works.

Thank you very much!