!5257 Fix no attribute'_graph_data' error in graphdata.py

Merge pull request !5257 from heleiwang/r0.7_fix_graphdata
This commit is contained in:
mindspore-ci-bot 2020-08-27 16:44:21 +08:00 committed by Gitee
commit f01613508f
1 changed files with 4 additions and 3 deletions

View File

@ -55,8 +55,8 @@ class GraphData:
set the number of clients expected to connect, and the server will allocate corresponding
resources according to this parameter (default=1).
auto_shutdown (bool, optional): Valid when working_mode is set to 'server',
Control when all clients have connected and no client connected to the server,
automatically exit the server (default=True).
when the number of connected clients reaches num_client and no client is being connected,
the server automatically exits (default=True).
"""
@check_gnn_graphdata
@ -69,14 +69,15 @@ class GraphData:
def stop():
self._graph_data.stop()
atexit.register(stop)
if working_mode in ['local', 'client']:
self._graph_data = GraphDataClient(dataset_file, num_parallel_workers, working_mode, hostname, port)
atexit.register(stop)
if working_mode == 'server':
self._graph_data = GraphDataServer(
dataset_file, num_parallel_workers, hostname, port, num_client, auto_shutdown)
atexit.register(stop)
try:
while self._graph_data.is_stoped() is not True:
time.sleep(1)