报错描述
Traceback (most recent call last):
File "tools/train.py", line 164, in <module>
main()
File "tools/train.py", line 156, in main
train_model(model, datasets, cfg, validate=args.validate, test=test_option, timestamp=timestamp, meta=meta)
File "/root/pyskl/pyskl/apis/train.py", line 144, in train_model
runner.run(data_loaders, cfg.workflow, cfg.total_epochs)
File "/root/miniconda3/envs/pyskl/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 127, in run
epoch_runner(data_loaders[i], **kwargs)
File "/root/miniconda3/envs/pyskl/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 54, in train
self.call_hook('after_train_epoch')
File "/root/miniconda3/envs/pyskl/lib/python3.7/site-packages/mmcv/runner/base_runner.py", line 309, in call_hook
getattr(hook, fn_name)(self)
File "/root/miniconda3/envs/pyskl/lib/python3.7/site-packages/mmcv/runner/hooks/evaluation.py", line 267, in after_train_epoch
self._do_evaluate(runner)
File "/root/miniconda3/envs/pyskl/lib/python3.7/site-packages/mmcv/runner/hooks/evaluation.py", line 507, in _do_evaluate
key_score = self.evaluate(runner, results)
File "/root/miniconda3/envs/pyskl/lib/python3.7/site-packages/mmcv/runner/hooks/evaluation.py", line 364, in evaluate
results, logger=runner.logger, **self.eval_kwargs)
File "/root/pyskl/pyskl/datasets/base.py", line 138, in evaluate
if isinstance(results[0], list) or isinstance(results[0], tuple):
IndexError: list index out of range
问题描述
生成list文件的时候,由于只考虑了训练集,导致最终生成的ann_file注释文件就只有训练集
于是执行下面命令行的时候
bash tools/dist_train.sh configs/rgbpose_conv3d/pose_only.py 1 --validate --test-last --test-best
就会报错
解决方案
生成list文件的时候,需要考虑训练集测试集都包括进去,然后生成最终的ann_file注释文件
这样就不报错了。命令行就可以正常执行