Can't access attributes of pydot graph in networkx graph after conversion

My task is to generate a graph from a dot file (using pydot) and then convert the same as networkx graph. The problem that I faced was that the attributes of Graph (as I have given in the .dot file) is not present in the networkx graph. I also used read_dot() function which is again an error. My code is successfully working to visualize graphs but not its attribs.

My code is:

import pydot
import networkx as nx
(graph,) = pydot.graph_from_dot_file('')
G = nx.nx_pydot.from_pydot(graph)

My output is {}

Pls help me to fix the problem

Thanks from Mathan :)