导入tdqm
import tqdm
代码:
for batch_idx, (inputs, targets) in enumerate(tqdm(train_loader)):
inputs, targets = inputs.to(device), targets.to(device)
报错:
解决办法:
把导入改成:
from tqdm import tqdm
import tqdm
for batch_idx, (inputs, targets) in enumerate(tqdm(train_loader)):
inputs, targets = inputs.to(device), targets.to(device)
把导入改成:
from tqdm import tqdm