Git Product home page Git Product logo

Comments (4)

ttagu99 avatar ttagu99 commented on August 15, 2024 3

대훈님 감사요~. 아래는 대훈님 코드에서 파일로 가져다 쓰게끔 변경했습니다~.

image
위에서 부터 순서대로 submit 하게 됩니다.


import os
import sys
import time
import subprocess
from multiprocessing import Process
from datetime import datetime
import pandas as pd

team_name = "Zonber"       
data_name = "ir_ph2"     
start_wait_sec =  0
submit_list_path  = './submit_list.csv'

def run_submit(command):
    now = time.time()
    print(f"[Command] {command}")
    print(datetime.now())
    subprocess.call(command)
    print(f"[Collapsed time] {time.time() - now}")

if __name__ == "__main__":
    S_HOUR = 3601
    li_procs = []

    while(1):
        s_df = pd.read_csv(submit_list_path)
        for i in range(s_df.shape[0]):
            s = s_df.session[i]
            m = s_df.model[i]
            full_session = '/'.join([team_name, data_name, str(s)])
            full_command = f"nsml submit {full_session} {m}"
            li_procs.append(Process(target=run_submit, args=(full_command, )))

        now = time.time()
        time.sleep(start_wait_sec)

        for i, proc in enumerate(li_procs):
            proc.start()
            if i + 1 < len(li_procs):
                time.sleep(S_HOUR)

        for proc in li_procs:
            proc.join()
        print(f"Total collapsed time: {time.time() - now}")
        s_df.drop(s_df.index, inplace=True)
        s_df.to_csv(submit_list_path)

from ai-vision.

forestnoobie avatar forestnoobie commented on August 15, 2024 1

감사합니다. 안 그래도 위와 같은 기능이 있으면 좋겠다고 생각했었는데 공유해주셔서 감사합니다!

from ai-vision.

ttagu99 avatar ttagu99 commented on August 15, 2024 1

@ttagu99 오 대우님 감사합니다! 제 코드에 실례가 안된다면 반영해 놓아도 괜찮을까요?

네네~. 물론입니다~~

from ai-vision.

DaehunGwak avatar DaehunGwak commented on August 15, 2024

@ttagu99 오 대우님 감사합니다! 제 코드에 실례가 안된다면 반영해 놓아도 괜찮을까요?

from ai-vision.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.