huawei-noah / Efficient-AI-Backbones

Efficient AI Backbones including GhostNet, TNT and MLP, developed by Huawei Noah's Ark Lab.
4.07k stars 708 forks source link

VIG运行报错:UnboundLocalError: local variable 'input' referenced before assignment #179

Closed worker121 closed 1 year ago

worker121 commented 1 year ago

尊敬的作者,您好! 我在运行您的代码的时候遇到了这样的报错: Traceback (most recent call last): File "train.py", line 809, in main() File "train.py", line 603, in main train_metrics = train_epoch( File "train.py", line 662, in train_epoch for batch_idx, (input1, target) in enumerate(loader): File "/opt/conda/lib/python3.8/site-packages/timm/data/loader.py", line 102, in iter yield input, target UnboundLocalError: local variable 'input' referenced before assignmen 我的运行环境和readme文件中的一致,请问这个要怎么解决呢?

iamhankai commented 1 year ago

看日志是你的data loader没加载对,是不是数据集是空的啊

worker121 commented 1 year ago

我在train和val中各放了一个类别,想看看能不能运行。是需要完整的数据麻?

iamhankai commented 1 year ago

1个类别怎么分类啊,多放几个类别

worker121 commented 1 year ago

感谢您的热心帮助,代码可以正常运行了