AttributeError: 'Graph' object has no attribute 'is_meta'
Hi, Thanks for sharing the codes for ANet. The ANet is trained and validated successfully but an error occurred in loading the checkpoint. Here are the details:
10:02:04 Load checkpoint from model_epoch_1.pth
Traceback (most recent call last):
File "/home/my_project_dir/script/run.py", line 62, in
Hi, we are so sorry for our late response.
Could you please provide the package version that you are currently using right now, especially for torch and torchdrug?
As I checked in Torch's commit history, there is at least no such constraint if param.is_meta and not input_param.is_meta and not assign_to_params_buffers: for torch==1.13.1 (which is the one I'm using right now).
The update for this constraint takes place in the following commit: https://github.com/pytorch/pytorch/commit/ca7ece9b508822defc6eaa97fc9d5adafa201f69
I guess it's worth a try to pass assign=True as torch suggested in the warning to bypass this constraint.
Hi!
Does anyone know how to resolve this issue? I am using torch=2.3.0, torchdrug=0.2.1. I tried to set assign=True as @KatarinaYuan mentioned but it didn't help.
I tried to print out all keys and values pairs of the model state dictionary and I found these: "graph" : Graph(num_node=40943, num_edge=93003, num_relation=11, device='cuda:0') "fact_graph": Graph(num_node=40943, num_edge=86835, num_relation=11, device='cuda:0'). I am not sure if they are registered as parameters or buffers of the model intentionally and must be kept in the model state. I am not sure if I could pop this out of the model state dictionary. @KatarinaYuan @KiddoZhu