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

Semi-Supervised GCN example broken. #292

Open
Qfl3x opened this issue Apr 19, 2022 · 4 comments · May be fixed by #293
Open

Semi-Supervised GCN example broken. #292

Qfl3x opened this issue Apr 19, 2022 · 4 comments · May be fixed by #293

Comments

@Qfl3x
Copy link

Qfl3x commented Apr 19, 2022

I tried to run the Semi-Supervised GCN example and it appears to be broken. The issue is that the loss and accuracy functions don't seem to work with the DataLoader. The DataLoader's Batches have the format (X,y) with X being the graph vector and y being the (7*140*batch_size) output tensor. The current loop for (x,y) in batch takes the wrong elements at the moment:

FeaturedSubgraph of FeaturedGraph:
Undirected graph with (#V=2708, #E=5275) in adjacency matrix
Node feature:	ℝ^1433 <Matrix{Float32}>,1:140)  #This is x

FeaturedSubgraph of FeaturedGraph:
Undirected graph with (#V=2708, #E=5275) in adjacency matrix
Node feature:	ℝ^1433 <Matrix{Float32}>,1:140)  #This is y

0  #This is x

0 #This is y

#And Stop! (No more elements)

As evident, this breaks the whole thing. I've tried using zip but it plays weird with the y tensor. So my solution was to loop as such: for (x, y) in [[batch[1][i], batch[2][:,:,i]] for i = 1:batch_size], and it solved it. Though it may create memory overhead.

Julia Version 1.7.2

@Qfl3x Qfl3x linked a pull request Apr 19, 2022 that will close this issue
@yuehhua
Copy link
Member

yuehhua commented Apr 20, 2022

What's your Flux version?

@Qfl3x
Copy link
Author

Qfl3x commented Apr 20, 2022

0.13.0 (Latest stable release)

@yuehhua
Copy link
Member

yuehhua commented Apr 21, 2022

Weird. I cannot reproduce your issue. Dataloader works well with loss function in my side.

@Qfl3x
Copy link
Author

Qfl3x commented Apr 21, 2022

I did it again. This time in an environment with nothing but GeometricFlux (and its dependencies) both 0.11.1 (Package manager) and the master branch. To give an idea, the program crashes with this message (both times): ERROR: LoadError: MethodError: no method matching length(::FeaturedSubgraph{FeaturedGraph{SparseGraph{false, SparseArrays.SparseMatrixCSC{Float32, UInt32}, Vector{UInt32}, Int64}, Matrix{Float32}, FillArrays.Fill{Float32, 2, Tuple{Base.OneTo{Int64}, Base.OneTo{Int64}}}, FillArrays.Fill{Float32, 1, Tuple{Base.OneTo{Int64}}}}, UnitRange{Int64}})

EDIT: Corrected Error message, sorry.

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

Successfully merging a pull request may close this issue.

2 participants