Open wangguan1995 opened 7 months ago
assign type to be None will jump over this bug
type="float32" # not work
type= None # it works
Another severe issue(at least bothers me a lot): The graph has to be saved and loaded, even if it already exists in my PC memory:
dgl.save_graphs("./graph.bin", graph)
np.save("./x_in.npy", x_in.cpu().numpy())
np.save("./area.npy", area.cpu().numpy().reshape(-1, 1))
graph = dgl.load_graphs("./graph.bin")[0][0]
Each epoch of my training(500 graphs) will cost a huge IO time and enhance so little over my model.
As the provided google drive link doesn't contain a file named "x_in.npy", I assume it is replaced with the file "node_feat.npy". I found that the matrix is in shape (2, 3), which is inconsistent with the graph size.
x_in = np.load("node_feat.npy")
print(x_in.shape). # (2, 3)
Could you check your data uploaded and also the shape of your local x_in matrix?
I didn't quite get the second question. What's the purpose of such periodic saving?
@mfbalin Could you help to comment here?
@mfbalin Could you help to comment here?
I haven't used a custom dataset before, including gb.OnDiskFeatureData
. So I don't know what could be going wrong.
@wangguan1995 In the code snippet you shared, type
is wrongly used. It should be node/edge type name instead of data type you used: type="float32"
. Here's the correct way to instantiate OnDiskFeatureData
a = torch.tensor([[1, 2, 4], [2, 5, 3]])
b = torch.tensor([[[1, 2], [3, 4]], [[2, 5], [3, 4]]])
write_tensor_to_disk(test_dir, "a", a, fmt="torch")
write_tensor_to_disk(test_dir, "b", b, fmt="numpy")
feature_data = [
gb.OnDiskFeatureData(
domain="node",
type="paper",
name="a",
format="torch",
path=os.path.join(test_dir, "a.pt"),
),
gb.OnDiskFeatureData(
domain="edge",
type="paper:cites:paper",
name="b",
format="numpy",
path=os.path.join(test_dir, "b.npy"),
),
]
feature_store = gb.TorchBasedFeatureStore(feature_data)
Corresponding documentation is available here: https://docs.dgl.ai/generated/dgl.graphbolt.TorchBasedFeatureStore.html#dgl.graphbolt.TorchBasedFeatureStore
This issue has been automatically marked as stale due to lack of activity. It will be closed if no further activity occurs. Thank you
🐛 Bug
To Reproduce
Steps to reproduce the behavior:
1.Download data https://drive.google.com/drive/folders/1esJ-4ThKsaDQQLQMtZVowwkSlY8thJxr?usp=drive_link 2.Run This
Expected behavior
1024 src nodes feature "x_in" should be printed Many dst nodes features "x_in" should be printed
Environment
conda
,pip
, source): pipAdditional context