Пример #1
0
def MAIN_EXTRACT(args):
    set_global(args)
    cc_exist = False

    #ops.mkdir(cross_compiler_tarball_root)
    if ops.isExist(ops.path_join(cross_compiler_tarball_root,
                                 arch_cc_version)):
        cc_exist = True

    if not cc_exist:
        if cross_compiler_tarball_type == "XZ":
            ops.unTarXzSUDO(cross_compiler_tarball,
                            cross_compiler_tarball_root)
        elif cross_compiler_tarball_type == "BZ2":
            ops.unTarBz2SUDO(cross_compiler_tarball,
                             cross_compiler_tarball_root)
        elif cross_compiler_tarball_type == "GZ":
            ops.unTarGzSUDO(cross_compiler_tarball,
                            cross_compiler_tarball_root)
        else:
            sys.exit(1)
    #else:
    #    copy_cc_libs()
    copy_cc_libs()
    #copy_sdk_usr_libs()
    ops.mkdir(pkgconfig_dir)

    return True
Пример #2
0
 def check_dirs(self, single, multiple, **kwargs):
     path = self.workspace.join('single')
     ops.mkdir(path, **kwargs)
     self.assertEqual(os.path.isdir(path), single)
     path = self.workspace.join('multiple', 'levels', 'here')
     ops.mkdir(path, **kwargs)
     self.assertEqual(os.path.isdir(path), multiple)
Пример #3
0
def eval_resnet():
    sess_config = tf.ConfigProto()
    sess_config.gpu_options.allow_growth = True
    sess = tf.Session(config=sess_config)
    config = get_config(is_train=True)
    mkdir(config.result_dir)

    reg = ResNet(sess, config, "DIRNet", is_train=False)
    reg.restore(config.ckpt_dir)
    dh = DIRNetDatahandler(config=config)

    # print(reg.calc_rmse_all(dh.s_data, dh.d_data, config.result_dir + "/",save_images=False))
    batch_x, batch_y, batch_labels = dh.sample_pair(config.batch_size)
    # prediction = reg.deploy_with_labels(batch_x, batch_y, batch_labels)
    # print(str(prediction))

    amnt_pics = np.shape(dh.d_data)[0]
    acc = 0
    prev_x = np.empty(shape=(1, 222, 247))
    amnt_eva = np.shape(dh.d_data_eval)[0]
    for i in range(amnt_eva):
        batch_x, batch_y, batch_labels = dh.get_eval_pair_by_idx(i)
        if np.array_equal(prev_x, batch_x):
            print('weird')
        prev_x = batch_x
        # loss = reg.fit((1, batch_x[0], batch_x[1], batch_x[2]),
        #                (1, batch_y[0], batch_y[1], batch_y[2]))
        prediction = reg.deploy_with_labels(batch_x, batch_y, batch_labels)
        print(prediction,"::", batch_labels[0])
        truth = int(batch_labels[0])
        # print("pred {} truth {}".format(prediction, truth))
        if prediction == truth:
            acc += 1
    print("Acc: {0:.4f}".format(acc / amnt_eva))
Пример #4
0
def MAIN_BUILD(args):
    set_global(args)

    ops.mkdir(install_dir)
    ops.mkdir(install_tmp_dir)
    iopc.make(tarball_dir)
    iopc.make_install(tarball_dir)

    ops.mkdir(install_dir)
    ops.mkdir(dst_lib_dir)

    ops.copyto(
        ops.path_join(install_tmp_dir, "usr/local/lib/libdbus-1.so.3.19.8"),
        dst_lib_dir)
    ops.ln(dst_lib_dir, "libdbus-1.so.3.19.8", "libdbus-1.so.3.19")
    ops.ln(dst_lib_dir, "libdbus-1.so.3.19.8", "libdbus-1.so.3")
    ops.ln(dst_lib_dir, "libdbus-1.so.3.19.8", "libdbus-1.so")

    ops.mkdir(tmp_include_dir)
    ops.copyto(ops.path_join(install_tmp_dir, "usr/local/include/."),
               tmp_include_dir)
    ops.copyto(
        ops.path_join(install_tmp_dir, "usr/local/lib/dbus-1.0/include/."),
        tmp_include_dir)

    return True
Пример #5
0
def MAIN_BUILD(args):
    set_global(args)

    ops.mkdir(install_dir)
    ops.mkdir(install_tmp_dir)
    iopc.make(tarball_dir)
    '''
    iopc.make_install(tarball_dir)

    ops.mkdir(install_dir)
    ops.mkdir(dst_lib_dir)
    ops.mkdir(dst_usr_local_lib_dir)
    libGLU = "libGLU.so.1.3.1"
    ops.copyto(ops.path_join(install_tmp_dir, "usr/local/lib/" + libGLU), dst_lib_dir)
    ops.ln(dst_lib_dir, libGLU, "libGLU.so.1.3")
    ops.ln(dst_lib_dir, libGLU, "libGLU.so.1")
    ops.ln(dst_lib_dir, libGLU, "libGLU.so")

    ops.mkdir(tmp_include_dir)
    ops.copyto(ops.path_join(install_tmp_dir, "usr/local/include/."), tmp_include_dir)

    ops.mkdir(dst_pkgconfig_dir)
    #ops.copyto(ops.path_join(src_pkgconfig_dir, '.'), dst_pkgconfig_dir)
    '''
    return True
Пример #6
0
 def check_dirs(self, single, multiple, **kwargs):
     path = self.workspace.join('single')
     ops.mkdir(path, **kwargs)
     self.assertEqual(os.path.isdir(path), single)
     path = self.workspace.join('multiple', 'levels', 'here')
     ops.mkdir(path, **kwargs)
     self.assertEqual(os.path.isdir(path), multiple)
Пример #7
0
def MAIN_BUILD(args):
    set_global(args)

    ops.mkdir(install_dir)
    ops.mkdir(install_tmp_dir)
    iopc.make(tarball_dir)
    iopc.make_install(tarball_dir)

    ops.mkdir(dst_lib_dir)

    libfreetype = "libfreetype.so.6.16.1"
    ops.copyto(ops.path_join(install_tmp_dir, "usr/local/lib/" + libfreetype),
               dst_lib_dir)
    ops.ln(dst_lib_dir, libfreetype, "libfreetype.so.6.16")
    ops.ln(dst_lib_dir, libfreetype, "libfreetype.so.6")
    ops.ln(dst_lib_dir, libfreetype, "libfreetype.so")

    ops.mkdir(dst_include_dir)
    ops.copyto(ops.path_join(install_tmp_dir, "usr/local/include/."),
               dst_include_dir)

    ops.mkdir(dst_pkgconfig_dir)
    ops.copyto(ops.path_join(src_pkgconfig_dir, '.'), dst_pkgconfig_dir)

    return False
Пример #8
0
def copy_sdk_usr_libs():
    ops.mkdir(dst_usr_lib_dir)
    ops.copyto(ops.path_join(cc_sdk_sysroot, "Mcrt1.o"), dst_usr_lib_dir)
    ops.copyto(ops.path_join(cc_sdk_sysroot, "Scrt1.o"), dst_usr_lib_dir)
    ops.copyto(ops.path_join(cc_sdk_sysroot, "crt1.o"), dst_usr_lib_dir)
    ops.copyto(ops.path_join(cc_sdk_sysroot, "crti.o"), dst_usr_lib_dir)
    ops.copyto(ops.path_join(cc_sdk_sysroot, "crtn.o"), dst_usr_lib_dir)
    ops.copyto(ops.path_join(cc_sdk_sysroot, "gcrt1.o"), dst_usr_lib_dir)
Пример #9
0
def MAIN_BUILD(args):
    set_global(args)

    ops.mkdir(install_dir)
    ops.mkdir(install_tmp_dir)
    iopc.make(tarball_dir)
    iopc.make_install(tarball_dir)
    return True
Пример #10
0
def train_ResNet():
    sess_config = tf.ConfigProto()
    sess_config.gpu_options.allow_growth = True
    sess = tf.Session(config=sess_config)
    config = get_config(is_train=True)
    mkdir(config.tmp_dir)
    mkdir(config.ckpt_dir)

    reg = ResNet(sess, config, "DIRNet", is_train=True)
    # reg.restore(config.ckpt_dir)
    dh = DIRNetDatahandler(config=config)

    amnt_pics = np.shape(dh.d_data)[0]
    for epoch in range(5):
        loss_sum = 0
        acc = 0
        for i in range(amnt_pics - 1):
            batch_x, batch_y, batch_labels = dh.get_pair_by_idx(i)

            # loss = reg.fit((1, batch_x[0], batch_x[1], batch_x[2]),
            #                (1, batch_y[0], batch_y[1], batch_y[2]))
            loss, prediction = reg.fit(batch_x, batch_y, batch_labels)
            loss2, prediction2 = reg.fit(batch_y, batch_x, batch_labels)
            loss_sum += (loss + loss2) / 2
            prediction = int(prediction[0])
            truth = int(batch_labels[0])
            # print("pred {} truth {}".format(prediction, truth))
            if prediction == truth:
                acc += 1
            if prediction2[0] == truth:
                acc += 1
        print("epoch {0}: Loss: {1:.4f} Acc: {2:.4f}".format(
            epoch, loss_sum / (amnt_pics * 2), acc / (amnt_pics * 2)))

        if (epoch + 1) % 5 == 0:
            # if (epoch+1) % config.checkpoint_distance == 0:
            # reg.deploy(config.tmp_dir, batch_x, batch_y)
            print('saving model...')
            # reg.save(config.ckpt_dir)

    amnt_pics = np.shape(dh.d_data)[0]
    acc = 0
    prev_x = np.empty(shape=(1, 222, 247))
    amnt_eva = np.shape(dh.d_data_eval)[0]
    for i in range(amnt_eva):
        batch_x, batch_y, batch_labels = dh.get_eval_pair_by_idx(i)
        if np.array_equal(prev_x, batch_x):
            print('weird')
        prev_x = batch_x
        # loss = reg.fit((1, batch_x[0], batch_x[1], batch_x[2]),
        #                (1, batch_y[0], batch_y[1], batch_y[2]))
        prediction = reg.deploy_with_labels(batch_x, batch_y, batch_labels)
        print(prediction, "::", batch_labels[0])
        truth = int(batch_labels[0])
        # print("pred {} truth {}".format(prediction, truth))
        if prediction == truth:
            acc += 1
    print("Acc: {0:.4f}".format(acc / amnt_eva))
Пример #11
0
 def test_bad_permissions(self):
     path = None
     name = 'test'
     with ops.workspace() as w:
         path = w.path
         ops.mkdir(w.join(name))
         ops.chmod(w.path, 0000)
         self.assertTrue(os.path.isdir(path))
     self.assertFalse(os.path.exists(path))
Пример #12
0
def MAIN_EXTRACT(args):
    set_global(args)

    ops.mkdir(output_platform_dir)
    ops.copyto(ops.path_join(pkg_path, dao_script), output_platform_dir)
    ops.copyto(ops.path_join(pkg_path, daosfs_script), output_platform_dir)
    ops.copyto(ops.path_join(pkg_path, header_script), output_platform_dir)

    return True
Пример #13
0
 def test_bad_permissions(self):
     path = None
     name = 'test'
     with ops.workspace() as w:
         path = w.path
         ops.mkdir(w.join(name))
         ops.chmod(w.path, 0000)
         self.assertTrue(os.path.isdir(path))
     self.assertFalse(os.path.exists(path))
Пример #14
0
def MAIN_EXTRACT(args):
    set_global(args)

    ops.mkdir(output_platform_dir)
    for ini in dao_files:
        dao_file = ops.path_join(pkg_path, ini + ".ini")
        ops.copyto(dao_file, output_platform_dir)
        ops.copyto(dao_file, output_dir)

    return True
Пример #15
0
def MAIN_EXTRACT(args):
    set_global(args)

    ops.mkdir(dst_lib_dir)
    ops.copyto(ops.path_join(src_usr_lib_dir, "libdb-5.3.so"), dst_lib_dir)
    ops.ln(dst_lib_dir, "libdb-5.3.so", "libdb.so")
    #ops.mkdir(dst_include_dir)
    #iopc.installBin(args["pkg_name"], ops.path_join(src_include_dir, "db_185.h"), dst_include_dir)
    #iopc.installBin(args["pkg_name"], ops.path_join(src_include_dir, "db.h"), dst_include_dir)
    return True
Пример #16
0
def MAIN_EXTRACT(args):
    set_global(args)

    ops.mkdir(dst_lib_dir)
    lib_so = "libjson-c.so.2.0.0"
    ops.copyto(ops.path_join(src_lib_dir, lib_so), dst_lib_dir)
    ops.ln(dst_lib_dir, lib_so, "libjson-c.so.2.0")
    ops.ln(dst_lib_dir, lib_so, "libjson-c.so.2")
    ops.ln(dst_lib_dir, lib_so, "libjson-c.so")

    return True
Пример #17
0
def MAIN_EXTRACT(args):
    set_global(args)

    ops.mkdir(dst_lib_dir)
    ops.copyto(ops.path_join(src_lib_dir, "libudev.so.1.6.5"), dst_lib_dir)
    ops.ln(dst_lib_dir, "libudev.so.1.6.5", "libudev.so.1.6")
    ops.ln(dst_lib_dir, "libudev.so.1.6.5", "libudev.so.1")
    ops.ln(dst_lib_dir, "libudev.so.1.6.5", "libudev.so")

    ops.mkdir(tmp_include_dir)
    ops.copyto(ops.path_join(src_include_dir, 'libudev.h'), tmp_include_dir)
    return True
Пример #18
0
def MAIN_EXTRACT(args):
    set_global(args)

    ops.mkdir(dst_lib_dir)
    ops.copyto(ops.path_join(src_lib_dir, "libuuid.so.1.3.0"), dst_lib_dir)
    ops.ln(dst_lib_dir, "libuuid.so.1.3.0", "libuuid.so.1.3")
    ops.ln(dst_lib_dir, "libuuid.so.1.3.0", "libuuid.so.1")
    ops.ln(dst_lib_dir, "libuuid.so.1.3.0", "libuuid.so")

    ops.mkdir(tmp_include_dir)
    ops.copyto(ops.path_join(src_include_dir, 'uuid'), tmp_include_dir)
    return True
Пример #19
0
def main():
  config = get_config()

  A_path = config.A_path
  B_path = config.B_path
  dh = ISBIHandler(A_path, B_path, config.input_size)

  mkdir(config.ckpt_dir)
  mkdir(config.ckpt_dir+"/ckpt_T1")
  mkdir(config.ckpt_dir+"/ckpt_T2")
  mkdir(config.tmp_dir)

  config = tf.ConfigProto()
  config.gpu_options.allow_growth = True
  with tf.Session(config=config) as sess:
    trainer = Trainer(sess, dh, config)
    #trainer.restore()

    iter_ = 0 
    d_stop = False
    while iter_ < config.iter_num:
      results = trainer.train()

      print(iter_+1, results)

      if (iter_+1) % 100 == 0:
        trainer.save()
        trainer.deploy()
      iter_ += 1
Пример #20
0
def MAIN_EXTRACT(args):
    set_global(args)

    ops.mkdir(dst_lib_dir)
    ops.copyto(ops.path_join(src_lib_dir, "libexpat.so.1.6.0"), dst_lib_dir)
    ops.ln(dst_lib_dir, "libexpat.so.1.6.0", "libexpat.so.1.6")
    ops.ln(dst_lib_dir, "libexpat.so.1.6.0", "libexpat.so.1")
    ops.ln(dst_lib_dir, "libexpat.so.1.6.0", "libexpat.so")

    ops.mkdir(tmp_include_dir)
    ops.copyto(ops.path_join(src_include_dir, 'expat.h'), tmp_include_dir)
    ops.copyto(ops.path_join(src_include_dir, 'expat_external.h'), tmp_include_dir)
    ops.copyto(ops.path_join(ops.path_join(src_include_dir, src_arch_include_dir), 'expat_config.h'), tmp_include_dir)
    return True
Пример #21
0
def MAIN_BUILD(args):
    set_global(args)

    ops.mkdir(install_dir)
    ops.mkdir(install_tmp_dir)
    iopc.make(tarball_dir)
    iopc.make_install(tarball_dir)

    ops.mkdir(dst_lib_dir)

    libgio = "libgio-2.0.so.0.5400.3"
    ops.copyto(ops.path_join(install_tmp_dir, "usr/local/lib/" + libgio),
               dst_lib_dir)
    ops.ln(dst_lib_dir, libgio, "libgio-2.0.so.0")
    ops.ln(dst_lib_dir, libgio, "libgio-2.0.so")

    libglib = "libglib-2.0.so.0.5400.3"
    ops.copyto(ops.path_join(install_tmp_dir, "usr/local/lib/" + libglib),
               dst_lib_dir)
    ops.ln(dst_lib_dir, libglib, "libglib-2.0.so.0")
    ops.ln(dst_lib_dir, libglib, "libglib-2.0.so")

    libgmodule = "libgmodule-2.0.so.0.5400.3"
    ops.copyto(ops.path_join(install_tmp_dir, "usr/local/lib/" + libgmodule),
               dst_lib_dir)
    ops.ln(dst_lib_dir, libgmodule, "libgmodule-2.0.so.0")
    ops.ln(dst_lib_dir, libgmodule, "libgmodule-2.0.so")

    libgobject = "libgobject-2.0.so.0.5400.3"
    ops.copyto(ops.path_join(install_tmp_dir, "usr/local/lib/" + libgobject),
               dst_lib_dir)
    ops.ln(dst_lib_dir, libgobject, "libgobject-2.0.so.0")
    ops.ln(dst_lib_dir, libgobject, "libgobject-2.0.so")

    libgthread = "libgthread-2.0.so.0.5400.3"
    ops.copyto(ops.path_join(install_tmp_dir, "usr/local/lib/" + libgthread),
               dst_lib_dir)
    ops.ln(dst_lib_dir, libgthread, "libgthread-2.0.so.0")
    ops.ln(dst_lib_dir, libgthread, "libgthread-2.0.so")

    ops.mkdir(dst_include_dir)
    ops.copyto(ops.path_join(tarball_dir, "glib/glibconfig.h"),
               dst_include_dir)
    ops.copyto(ops.path_join(install_tmp_dir, "usr/local/include/."),
               dst_include_dir)

    ops.mkdir(dst_pkgconfig_dir)
    ops.copyto(ops.path_join(src_pkgconfig_dir, '.'), dst_pkgconfig_dir)

    return False
Пример #22
0
def MAIN_EXTRACT(args):
    set_global(args)

    ops.mkdir(dst_lib_dir)
    ops.copyto(ops.path_join(src_usr_lib_dir, "libtokyocabinet.so.9.11.0"), dst_lib_dir)
    ops.ln(dst_lib_dir, "libtokyocabinet.so.9.11.0", "libtokyocabinet.so.9.11")
    ops.ln(dst_lib_dir, "libtokyocabinet.so.9.11.0", "libtokyocabinet.so.9")
    ops.ln(dst_lib_dir, "libtokyocabinet.so.9.11.0", "libtokyocabinet.so")

    ops.copyto(ops.path_join(src_usr_lib_dir2, "libtokyotyrant.so.3.23.0"), dst_lib_dir)
    ops.ln(dst_lib_dir, "libtokyotyrant.so.3.23.0", "libtokyotyrant.so.3.23")
    ops.ln(dst_lib_dir, "libtokyotyrant.so.3.23.0", "libtokyotyrant.so.3")
    ops.ln(dst_lib_dir, "libtokyotyrant.so.3.23.0", "libtokyotyrant.so")

    return True
Пример #23
0
def main():
    sess = tf.Session()
    config = get_config(is_train=False)
    mkdir(config.result_dir)

    reg = RegNet(sess, config, "RegNet", is_train=False)
    reg.restore(config.ckpt_dir)
    dh = DataHandler("Curious_data", is_train=False)

    for i in range(10):
        result_i_dir = config.result_dir + "/{}".format(i)
        mkdir(result_i_dir)

        batch_x, batch_y = dh.sample_pair(config.batch_size, i)
        reg.deploy(result_i_dir, batch_x, batch_y)
Пример #24
0
def MAIN_EXTRACT(args):
    set_global(args)

    ops.mkdir(dst_bin_dir)
    ops.copyto(ops.path_join(src_sbin_dir, "mkfs.btrfs"), dst_bin_dir)
    ops.copyto(ops.path_join(src_sbin_dir, "btrfs"), dst_bin_dir)

    ops.mkdir(dst_lib_dir)
    lib_so = "liblzo2.so.2.0.0"
    ops.copyto(ops.path_join(src_lib_dir, lib_so), dst_lib_dir)
    ops.ln(dst_lib_dir, lib_so, "liblzo2.so.2.0")
    ops.ln(dst_lib_dir, lib_so, "liblzo2.so.2")
    ops.ln(dst_lib_dir, lib_so, "liblzo2.so")

    return True
Пример #25
0
def MAIN_EXTRACT(args):
    set_global(args)

    lib_so = "libmicrohttpd.so.10.27.0"

    ops.mkdir(dst_lib_dir)
    ops.copyto(ops.path_join(src_usr_lib_dir, lib_so), dst_lib_dir)
    ops.ln(dst_lib_dir, lib_so, "libmicrohttpd.so.10.27")
    ops.ln(dst_lib_dir, lib_so, "libmicrohttpd.so.10")
    ops.ln(dst_lib_dir, lib_so, "libmicrohttpd.so")

    ops.mkdir(src_include_dir)
    ops.copyto(ops.path_join(base_include_dir, "microhttpd.h"),
               src_include_dir)
    return False
def main():
    sess = tf.Session()
    config = get_config(is_train=False)
    mkdir(config.result_dir)

    reg = DIRNet(sess, config, "DIRNet", is_train=False)
    reg.restore(config.ckpt_dir)
    #dh = MNISTDataHandler("MNIST_data", is_train=False)
    dh = AryllaDataHandler("MNIST_data", is_train=False)

    for i in range(2):
        result_i_dir = config.result_dir + "/{}".format(i)
        mkdir(result_i_dir)

        batch_x, batch_y = dh.sample_pair(config.batch_size, i)
        reg.deploy(result_i_dir, batch_x, batch_y)
Пример #27
0
def main():
    sess = tf.Session()
    config = get_config(is_train=True)
    mkdir(config.tmp_dir)
    mkdir(config.ckpt_dir)
    q = 100
    reg = DIRNet(sess, config, "DIRNet", is_train=True)
    dh = MNISTDataHandler("MNIST_data", is_train=True)

    for i in range(config.iteration):
        batch_x, batch_y = dh.sample_pair(config.batch_size)
        loss = reg.fit(batch_x, batch_y)
        print("iter {:>6d} : {}".format(i + 1, loss))

        if (i + 1) % 1000 == 0:
            reg.deploy(config.tmp_dir, batch_x, batch_y)
            reg.save(config.ckpt_dir)
Пример #28
0
def MAIN_BUILD(args):
    set_global(args)

    ops.mkdir(install_dir)
    ops.mkdir(install_tmp_dir)
    iopc.make(tarball_dir)
    iopc.make_install(tarball_dir)

    ops.mkdir(install_dir)
    ops.mkdir(dst_lib_dir)
    libmtdev = "libmtdev.so.1.0.0"
    ops.copyto(ops.path_join(install_tmp_dir, "usr/local/lib/" + libmtdev), dst_lib_dir)
    ops.ln(dst_lib_dir, libmtdev, "libmtdev.so.1.0")
    ops.ln(dst_lib_dir, libmtdev, "libmtdev.so.1")
    ops.ln(dst_lib_dir, libmtdev, "libmtdev.so")

    ops.mkdir(tmp_include_dir)
    ops.copyto(ops.path_join(install_tmp_dir, "usr/local/include/."), tmp_include_dir)
    return False
Пример #29
0
def main():
  sess = tf.Session()
  config = get_config(is_train=True)
  mkdir(config.tmp_dir)
  mkdir(config.ckpt_dir)
  mkdir(config.result_dir)

  DIRNet_Model = DIRNet(sess, config, "DIRNet_tr", is_train=True)

  Train_Data = AryllaDataHandler("Data_1",  is_train = True)
  Eval_Data =  AryllaDataHandler("Data_2",  is_train = False)

  txt_dir = config.result_dir

  for i in range(config.iteration):
    batch_x, batch_y = Train_Data.sample_pair(config.batch_size)
    train_loss = DIRNet_Model.fit(batch_x, batch_y)

    batch_x_eval, batch_y_eval = Eval_Data.sample_pair(config.batch_size)
    eval_loss = DIRNet_Model.fit(batch_x_eval, batch_y_eval)

    print("Iteration {} ==> training ncc : {}, evaluate ncc : {} ".format(i+1, round(train_loss, 8), round(eval_loss, 8)))
    
    with open(txt_dir+'/data.txt','a') as f:    
      f.write(str(i)+" "+str(train_loss)+" "+str(eval_loss)+"\n")      

    if (i+1) % 1000 == 0:
      DIRNet_Model.deploy(config.tmp_dir, batch_x, batch_y)            
      DIRNet_Model.save(config.ckpt_dir)
      print("Model saved ... ...")

      for lable_id in range(2):
        result_i_dir = config.result_dir+"/{}".format(lable_id)
        DIRNet_Model.deploy(result_i_dir, batch_x_eval, batch_y_eval)   
Пример #30
0
def MAIN_EXTRACT(args):
    set_global(args)

    ops.mkdir(dst_sbin_dir)
    ops.copyto(ops.path_join(src_sbin_dir, "badblocks"), dst_sbin_dir)
    ops.copyto(ops.path_join(src_sbin_dir, "mke2fs"), dst_sbin_dir)
    ops.ln(dst_sbin_dir, "mke2fs", "mkfs.ext4")
    ops.copyto(ops.path_join(src_sbin_dir, "resize2fs"), dst_sbin_dir)
    ops.copyto(ops.path_join(src_sbin_dir, "tune2fs"), dst_sbin_dir)

    ops.mkdir(dst_lib_dir)

    lib_so = "libext2fs.so.2.4"
    ops.copyto(ops.path_join(src_lib_dir, lib_so), dst_lib_dir)
    ops.ln(dst_lib_dir, lib_so, "libext2fs.so.2")
    ops.ln(dst_lib_dir, lib_so, "libext2fs.so")

    lib_so = "libcom_err.so.2.1"
    ops.copyto(ops.path_join(src_lib_dir, lib_so), dst_lib_dir)
    ops.ln(dst_lib_dir, lib_so, "libcom_err.so.2")
    ops.ln(dst_lib_dir, lib_so, "libcom_err.so")

    lib_so = "libblkid.so.1.1.0"
    ops.copyto(ops.path_join(src_lib_dir, lib_so), dst_lib_dir)
    ops.ln(dst_lib_dir, lib_so, "libblkid.so.1.1")
    ops.ln(dst_lib_dir, lib_so, "libblkid.so.1")
    ops.ln(dst_lib_dir, lib_so, "libblkid.so")

    lib_so = "libuuid.so.1.3.0"
    ops.copyto(ops.path_join(src_lib_dir, lib_so), dst_lib_dir)
    ops.ln(dst_lib_dir, lib_so, "libuuid.so.1.3")
    ops.ln(dst_lib_dir, lib_so, "libuuid.so.1")
    ops.ln(dst_lib_dir, lib_so, "libuuid.so")

    lib_so = "libe2p.so.2.3"
    ops.copyto(ops.path_join(src_lib_dir, lib_so), dst_lib_dir)
    ops.ln(dst_lib_dir, lib_so, "libe2p.so.2")
    ops.ln(dst_lib_dir, lib_so, "libe2p.so")

    return True
Пример #31
0
def MAIN_BUILD(args):
    set_global(args)

    ops.mkdir(install_dir)
    ops.mkdir(install_tmp_dir)
    iopc.make(tarball_dir)
    iopc.make_install(tarball_dir)

    ops.mkdir(install_dir)
    ops.mkdir(dst_lib_dir)
    libfontconfig = "libfontconfig.so.1.11.1"
    ops.copyto(
        ops.path_join(install_tmp_dir, "usr/local/lib/" + libfontconfig),
        dst_lib_dir)
    ops.ln(dst_lib_dir, libfontconfig, "libfontconfig.so.1.11")
    ops.ln(dst_lib_dir, libfontconfig, "libfontconfig.so.1")
    ops.ln(dst_lib_dir, libfontconfig, "libfontconfig.so")

    ops.mkdir(tmp_include_dir)
    ops.copyto(ops.path_join(install_tmp_dir, "usr/local/include/."),
               tmp_include_dir)
    return True
Пример #32
0
def MAIN_EXTRACT(args):
    set_global(args)

    ops.mkdir(output_rootfs_dir)
    CMD = ['python2.7', storage_generator, ops.path_join(output_rootfs_dir, 'hda.img')] 
    ops.execCmd(CMD, pkg_path, False)

    CMD = ['python2.7', storage_generator, ops.path_join(output_rootfs_dir, 'vda.img')] 
    ops.execCmd(CMD, pkg_path, False)

    CMD = ['python2.7', storage_generator, ops.path_join(output_rootfs_dir, 'vdb.img')] 
    ops.execCmd(CMD, pkg_path, False)

    CMD = ['python2.7', storage_generator, ops.path_join(output_rootfs_dir, 'vdc.img')] 
    ops.execCmd(CMD, pkg_path, False)

    CMD = ['python2.7', storage_generator, ops.path_join(output_rootfs_dir, 'vdd.img')] 
    ops.execCmd(CMD, pkg_path, False)

    CMD = ['python2.7', storage_generator, ops.path_join(output_rootfs_dir, 'vde.img')] 
    ops.execCmd(CMD, pkg_path, False)

    return True
Пример #33
0
def MAIN_BUILD(args):
    set_global(args)

    ops.mkdir(install_dir)
    ops.mkdir(install_tmp_dir)
    iopc.make(tarball_dir)
    iopc.make_install(tarball_dir)

    ops.mkdir(install_dir)
    ops.mkdir(dst_lib_dir)
    libharfbuzz_subset = "libharfbuzz-subset.so.0.10706.0"
    ops.copyto(
        ops.path_join(install_tmp_dir, "usr/local/lib/" + libharfbuzz_subset),
        dst_lib_dir)
    ops.ln(dst_lib_dir, libharfbuzz_subset, "libharfbuzz-subset.so.0.10706")
    ops.ln(dst_lib_dir, libharfbuzz_subset, "libharfbuzz-subset.so.0")
    ops.ln(dst_lib_dir, libharfbuzz_subset, "libharfbuzz-subset.so")

    libharfbuzz = "libharfbuzz.so.0.10706.0"
    ops.copyto(ops.path_join(install_tmp_dir, "usr/local/lib/" + libharfbuzz),
               dst_lib_dir)
    ops.ln(dst_lib_dir, libharfbuzz, "libharfbuzz.so.0.10706")
    ops.ln(dst_lib_dir, libharfbuzz, "libharfbuzz.so.0")
    ops.ln(dst_lib_dir, libharfbuzz, "libharfbuzz.so")

    libharfbuzz_icu = "libharfbuzz-icu.so.0.10706.0"
    ops.copyto(
        ops.path_join(install_tmp_dir, "usr/local/lib/" + libharfbuzz_icu),
        dst_lib_dir)
    ops.ln(dst_lib_dir, libharfbuzz_icu, "libharfbuzz-icu.so.0.10706")
    ops.ln(dst_lib_dir, libharfbuzz_icu, "libharfbuzz-icu.so.0")
    ops.ln(dst_lib_dir, libharfbuzz_icu, "libharfbuzz-icu.so")

    ops.mkdir(tmp_include_dir)
    ops.copyto(ops.path_join(install_tmp_dir, "usr/local/include/."),
               tmp_include_dir)
    return False
Пример #34
0
Файл: brpm.py Проект: silas/brpm
    def run(self):
        if os.path.exists(self.build_path):
            ops.rm(self.build_path, recursive=True)
        ops.mkdir(self.build_path)

        # Build repository directories
        for arch in ["SRPMS"] + self.options.arch:
            path = os.path.join(self.repo_path, "build", self.dist_name, self.dist_version, arch)
            ops.mkdir(path)
            if not os.path.exists(os.path.join(path, "repodata")):
                ops.run("createrepo --update ${dst}", dst=path, **self.ops_run)

        # Try to get source files if they don't exist locally
        self.sources()

        # Build SRPM
        result = self.srpm()
        if result:
            self.srpm_path = result.stdout.strip()[7:]
        else:
            ops.exit(code=result.code)

        srpm_dst_path = os.path.join(self.repo_path, "build", self.dist_name, self.dist_version, "SRPMS")

        # Build RPMs
        for arch in self.options.arch:
            result = self.rpm(arch)
            if not result:
                ops.exit(code=result.code, text=result.stderr)
            arch_dst_path = os.path.join(self.repo_path, "build", self.dist_name, self.dist_version, arch)
            ops.mkdir(arch_dst_path)
            # TODO(silas):  don't build multiple times on noarch
            ops.run("mv ${src}/*.noarch.rpm ${dst}", src=self.build_path, dst=arch_dst_path, **self.ops_run)
            arch_list = [arch]
            if arch == "i386":
                arch_list.append("i686")
            for a in arch_list:
                ops.run("mv ${src}/*${arch}.rpm ${dst}", src=self.build_path, arch=a, dst=arch_dst_path, **self.ops_run)
            # Find and move distribution srpm
            srpms = glob.glob(os.path.join(self.build_path, "*.src.rpm"))
            srpms = [os.path.basename(path) for path in srpms]
            srpm_name = os.path.basename(self.srpm_path)
            if srpm_name in srpms:
                srpms.remove(srpm_name)
            srpm_path = os.path.join(self.build_path, srpms[0]) if srpms else self.srpm_path
            ops.run("mv ${src} ${dst}", src=srpm_path, dst=srpm_dst_path, **self.ops_run)
            # Update repository
            ops.run("createrepo --update ${dst}", dst=arch_dst_path, **self.ops_run)
Пример #35
0
def MAIN_INSTALL(args):
    set_global(args)

    ops.mkdir(install_dir)

    ops.mkdir(dst_lib_dir)

    libcairo = "libcairo.so.2.11400.12"
    ops.copyto(ops.path_join(install_tmp_dir, "usr/local/lib/" + libcairo), dst_lib_dir)
    ops.ln(dst_lib_dir, libcairo, "libcairo.so.2")
    ops.ln(dst_lib_dir, libcairo, "libcairo.so")

    ops.mkdir(dst_include_dir)
    ops.copyto(ops.path_join(install_tmp_dir, "usr/local/include/cairo/cairo-deprecated.h"), dst_include_dir)
    ops.copyto(ops.path_join(install_tmp_dir, "usr/local/include/cairo/cairo-features.h"), dst_include_dir)
    ops.copyto(ops.path_join(install_tmp_dir, "usr/local/include/cairo/cairo.h"), dst_include_dir)
    ops.copyto(ops.path_join(install_tmp_dir, "usr/local/include/cairo/cairo-script.h"), dst_include_dir)
    ops.copyto(ops.path_join(install_tmp_dir, "usr/local/include/cairo/cairo-version.h"), dst_include_dir)

    iopc.installBin(args["pkg_name"], ops.path_join(ops.path_join(install_dir, "lib"), "."), "lib")
    iopc.installBin(args["pkg_name"], dst_include_dir, "include")

    return False