Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 |
Tags
- 성장형마인드셋
- 99클럽
- 백준
- 날씨API
- 자바
- 참조변수타입변환
- API
- Java
- ChatGPT
- 배열탐색
- 향상된for문
- 프로젝트
- 4A피드백
- 스프링
- 제너릭메서드
- Spring
- 재귀적사고
- SQ3R
- 파일사용권한
- 스레드동기화
- staging_area
- SQL
- 코딩테스트
- 루트사용자
- 동전교환알고리즘
- API명세서
- 프로그래머스
- 네이티브애플리케이션
- string메서드
- openapi
Archives
- Today
- Total
개발 공부용
java.lang.IllegalArgumentException: Cannot copy to a TensorFlowLite tensor (serving_default_input_1:0) with 4915200 bytes from a Java Buffer with 1638400 bytes. 본문
Error
java.lang.IllegalArgumentException: Cannot copy to a TensorFlowLite tensor (serving_default_input_1:0) with 4915200 bytes from a Java Buffer with 1638400 bytes.
솝제로 2024. 8. 2. 03:19TensorFlowLite 모델의 output과 이 output을 저장할 JavaBuffer의 크기가 맞지 않아서 생기는 오류.
https://netron.app/ 에서 모델을 열고 output 크기를 확인한 뒤 맞춰서 JavaBuffer를 만들어 주면 된다.
우리 모델은 float32[1, 25200, 6]으로 3차원 배열이었다.
// 이미지 데이터를 ByteBuffer로 변환
ByteBuffer byteBuffer = convertBitmapToByteBuffer(resizedBitmap);
float[][][] result = new float[1][25200][6];
interpreter.run(byteBuffer, result);
따라서 이렇게 만들어 주었다.
'Error' 카테고리의 다른 글
NullPointerException(NPE)가 발생하는 이유 (0) | 2025.04.11 |
---|---|
The dependencies of some of the beans in the application context form a cycle (1) | 2023.12.21 |