|
|
|
@ -33,15 +33,11 @@ class TrainerDesc(object):
|
|
|
|
|
# Workaround for relative import in protobuf under python3
|
|
|
|
|
# TODO: should be fixed
|
|
|
|
|
cur_path = os.path.dirname(__file__)
|
|
|
|
|
sys.path.append(cur_path)
|
|
|
|
|
sys.path.append(cur_path + "/proto")
|
|
|
|
|
|
|
|
|
|
# Just for fix random UT fail, will be deleted soon
|
|
|
|
|
print("cur_path: ", cur_path)
|
|
|
|
|
print("sys.path: ", sys.path)
|
|
|
|
|
if os.path.isdir(cur_path + "/proto"):
|
|
|
|
|
print("[listdir]")
|
|
|
|
|
print(os.listdir(cur_path + "/proto"))
|
|
|
|
|
if cur_path not in sys.path:
|
|
|
|
|
sys.path.append(cur_path)
|
|
|
|
|
if cur_path + "/proto" not in sys.path:
|
|
|
|
|
sys.path.append(cur_path + "/proto")
|
|
|
|
|
|
|
|
|
|
from proto import trainer_desc_pb2
|
|
|
|
|
self.proto_desc = trainer_desc_pb2.TrainerDesc()
|
|
|
|
|
import multiprocessing as mp
|
|
|
|
|