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 | 31 |
Tags
- pytorch
- 신경망
- 머신러닝
- VMwawre
- 딥러닝
- 밑바닥부터 시작하는 딥러닝
- window11
- Reinforce Learning
- 원격 데스크톱
- jupyter notebook
- conda
- tfrecord
- wsl2
- .wslconfig
- GPU
- window
- 메모리 제한
- docker
- 경사법
- 밑시딥1
- RuntimeError
- cudnn
- cuda
- 오류 해결
- 가상환경
- StyleGAN
- ubuntu
- Anaconda
- gpu 설정
- torchmetrics
Archives
- Today
- Total
이제라도 기록하기
[오류 해결] module 'tensorflow._api.v2.io' has no attribute 'tf_record_iterator' 본문
Error
[오류 해결] module 'tensorflow._api.v2.io' has no attribute 'tf_record_iterator'
sssky00 2024. 6. 3. 00:36발생한 오류
TFRecord 파일을 읽어오는 코드를 실행 도중 다음과 같은 오류가 발생하였다.
module 'tensorflow._api.v2.io' has no attribute 'tf_record_iterator'
기존 코드는 다음과 같다.
for serialized_example in tf.python_io.tf_record_iterator(f):
example = tf.train.Example()
example.ParseFromString(serialized_example)
위 코드에서 tf_record_iterator를 지원하지 않아서 생기는 오류로 추측된다.
참고로 TFRecord는 TensorFlow에서 데이터 세트를 저장하고 읽기 위해 사용하는 바이너리 파일 형식이다. TFRecord 파일은 대용량 데이터 세트를 효율적으로 저장하고 처리할 수 있도록 설계되어 있다고 한다.
해결 방법
기존 코드를 아래와 같이 변경해주면 해결된다!
dataset = tf.data.TFRecordDataset(f)
for serialized_example in dataset:
example = tf.train.Example()
example.ParseFromString(serialized_example.numpy())
'Error' 카테고리의 다른 글
[오류 해결] curl: command not found - ubuntu (0) | 2024.06.03 |
---|---|
[오류 해결] ERROR: no matching distribution found for torch==1.7.1+cu110 (0) | 2024.06.03 |
[오류 해결] unrar : command not found error - ubuntu (0) | 2024.06.03 |
[오류 해결] unzip : command not found - ubuntu (0) | 2024.06.03 |
[오류 해결] runtimeerror: dataloader worker (pid(s) 1534, 1535) exited unexpectedly (0) | 2024.06.03 |