pytorch/examples

MNIST test_loader not being used as intended (wrong)!

开放

#756 创建于 2020年4月19日

 (3 条评论) (0 个反应) (0 位负责人)Python (9,429 个派生)batch import
good first issue

仓库指标

星标
 (21,634 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

In the MNIST code, around line 57 (I think), the following code is wrong in my opinion for data, target in test_loader: It should be replaced by for idx,(data, target) in test_loader: The original code gives an error (int has no attribute .to(device)) as originally, data is actually assigned an integer (idx value) wrongly. I have verified this fix works. The code for training is correct but surprisingly there is a mistake in test code.

贡献者指南