コード例 #1
0
ファイル: loader.py プロジェクト: anglebinbin/Barista-tool
def getIterFromSolverstate(solverstate):
    """ Parse the iterations from the solverstate file.
    """
    from backend.caffe.path_loader import PathLoader
    proto = PathLoader().importProto()
    try:
        state = proto.SolverState()

        with open(solverstate, 'rb') as f:
            state.ParseFromString(f.read())
            return state.iter
    except Exception as e:
        print(str(e))
コード例 #2
0
ファイル: loader.py プロジェクト: anglebinbin/Barista-tool
def getCaffemodelFromSolverstate(solverstate):
    """ Parse the filename of the caffemodel file from the solverstate file.
    """
    from backend.caffe.path_loader import PathLoader
    proto = PathLoader().importProto()
    try:
        state = proto.SolverState()

        with open(solverstate, 'rb') as f:
            state.ParseFromString(f.read())
            return state.learned_net
    except Exception as e:
        print(str(e))