저번 답변을 얻고 진행한 결과
세션 실행하는 부분인 2단계에서 시간이 엄청 걸리더니
커널이 재시작되었습니다.
1.혹시 어디가 잘못된 걸까요?
2. dataset도 1x640x640x3으로 바꿔야하나요?
저번 답변을 얻고 진행한 결과
세션 실행하는 부분인 2단계에서 시간이 엄청 걸리더니
커널이 재시작되었습니다.
1.혹시 어디가 잘못된 걸까요?
2. dataset도 1x640x640x3으로 바꿔야하나요?
안녕하세요, FuriosaAI 김종욱입니다.
SDK-0.10.0 에서 사용하는 session 을 이용하여 코드를 작성을 해보고 실행을 해보았을때 컴파일하는 과정에서 약 20분정도가 소요되는 것을 확인하였습니다.
혹시 아래부분에 해당하는 코드에서 시간이 오래걸리는 것이 맞으실까요?
from furiosa.runtime.sync import create_runner
def preproc(img, input_size, swap=(2, 0, 1)):
if len(img.shape) == 3:
padded_img = np.ones((input_size[0], input_size[1], 3), dtype=np.uint8) * 114
else:
padded_img = np.ones(input_size, dtype=np.uint8) * 114
r = min(input_size[0] / img.shape[0], input_size[1] / img.shape[1])
resized_img = cv2.resize(
img,
(int(img.shape[1] * r), int(img.shape[0] * r)),
interpolation=cv2.INTER_LINEAR,
).astype(np.uint8)
padded_img[: int(img.shape[0] * r), : int(img.shape[1] * r)] = resized_img
# padded_img = padded_img.transpose(swap) # line 15
# padded_img = np.ascontiguousarray(padded_img, dtype=np.float32) # line 16
return padded_img, r
compiler_config = {
"permute_input": [
[0, 2, 3, 1],
],
}
total_predictions = 0
elapsed_time = 0
with create_runner(model_quantized, compiler_config=compiler_config) as session:
for image in islice(glob.iglob("coco/test2017/*.jpg"), 1000):
inputs = [preproc(cv2.imread(image), (640, 640))[0][np.newaxis, ...]]
start = time.perf_counter_ns()
outputs = session.run(inputs)
elapsed_time += time.perf_counter_ns() - start
total_predictions += 1
네 맞습니다
뭐가 꼬였었는지 20분이상 시간 걸리고 커널이 재시작되는 문제가
재부팅하고도 계속 발생했는데
다른 일을 한다고 컴의 전원선도 다 분리하고 보관하다가
다시 켜서 확인하니 지금은 정상적으로 됩니다. …
답변 감사합니다.