TypeError: ‘module‘ object is not callable

代碼

import tqdm
train_loader = DataLoader(
            train_dst, batch_size=params['batch_size'], shuffle=True, num_workers=4)
            
for a in tqdm(train_loader):
	print(a['image'].size(), a['label'].size())

報錯

    for a in tqdm(train_loader):
TypeError: 'module' object is not callable

Process finished with exit code 1

解決

    import torch

改成

    from tqdm import tqdm
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章