에러 모음
tqdm 사용시 TypeError: 'module' object is not callable
귤이두번
2023. 6. 14. 13:06
데이터로더를 만들고 이를 tqdm을 사용해 배치 하나씩 꺼내오려고 한다.
loader = DataLoader(dataset, batch_size=spec['batch_size'],
num_workers=16, pin_memory=True)
for batch in tqdm(loader, leave=False, desc='val'):
분명 데이터 로더도 잘 만들었고 문제가 없는것 같은데 다음과 같은 에러가 뜬다.
원인은 import에 있다.
import tqdm
을 하면 안되고
from tqdm import tqdm
을 해야 한다.
reference
https://stackoverflow.com/questions/39323182/tqdm-module-object-is-not-callable
tqdm: 'module' object is not callable
I import tqdm as this: import tqdm I am using tqdm to show progress in my python3 code, but I have the following error: Traceback (most recent call last): File "process.py", line 15, in <mo...
stackoverflow.com