量化模型的时候出现不预期的问题
环境
1.系统环境:ubuntu1804 2.MegEngine版本:1.4.0 3.python版本:3.6.8
复现步骤
- git clone https://github.com/MegEngine/Models.git
- python3 train.py -a resnet18 -d /path/to/imagenet --mode normal 出现此问题
请提供关键的代码片段便于追查问题
1、train.py 和 finetune.py 同样出现此问题
请提供完整的日志及报错信息
Traceback (most recent call last):
File "finetune.py", line 315, in
你好,根据你提供的日志,报错地点在这里:
def batch(self) -> Iterator[List[Any]]:
r"""
Batch method provides a batch indices generator.
"""
indices = list(self.sample())
# user might pass the world_size parameter without dist,
# so dist.is_distributed() should not be used
if self.world_size > 1:
indices = self.scatter(indices)
step, length = self.batch_size, len(indices)
batch_index = [indices[i : i + step] for i in range(0, length, step)]
if self.drop_last and len(batch_index[-1]) < self.batch_size:
batch_index.pop()
return iter(batch_index)
看起来不是模型层面的问题,可能是没有成功加载到输入数据。建议打日志确认一下这里的 self.sample() 返回的列表是否为空