definition of degree for graph and tree are different.
for graph, degree means no of edges connected to node (in undirected graph), or no of edges incoming or outgoing from node (in directed graph, as fanin-fanout or as indegree-outdegree)
for tree, degree means no of children (something equal to fanout in graph)