importosimportframework_pb2asframework_pb2defread_model(model_path):print('read_model.')path_8=unicode(model_path,'utf8')try:withopen(path_8,"rb")asf_model:printget_file_size(model_path)desc=framework_pb2.ProgramDesc()desc.ParseFromString(f_model.read())printdesc# print desc.blocksexceptIOError:print": File not found. Creating a new file."defget_file_size(file_path):file_path=unicode(file_path,'utf8')fsize=os.path.getsize(file_path)fsize=fsize/float(1024*1024)returnround(fsize,2)