새소식

AI LAB/🦜 TTS

7. UnsupportedOperation : not readable

  • -
728x90

파이썬 프로그램을 실행하던 도중 아래와 같은 에러에 직면하였습니다.

 

에러명

UnsupportedOperation : not readable

 

해결방법

r+ 모드로 옵션을 변경합니다.

파일을 여는 것(open)과 관련된 함수를 찾아서, r+ 옵션을 부여하였고 인코딩 utf8을 입력하였습니다.

with open(config.metadata_path, mode='r+', encoding='utf8') as f:

 

예제

file = open("File.txt","r")

 

옵션

"r" Opens a file for reading only.

"r+" Opens a file for both reading and writing.

"rb" Opens a file for reading only in binary format.

"rb+" Opens a file for both reading and writing in binary format.

"w" Opens a file for writing only.

 

python -m datasets.generate_data ./datasets/son/alignment.json
- UnsupportedOperation : not readable

 

반응형
Contents

포스팅 주소를 복사했습니다

이 글이 도움이 되었다면 공감 부탁드립니다.