Detectron2中运行demo.py时,报错:AssertionError: get_event_storage() has to be called inside a ‘with EventSt

问题描述

训练完模型以后,运行demo/demo.py去可视化结果,结果报错:

python demo/demo.py --config-file configs/PASCAL_VOC/base-training/R101_FPN_base_training_split1.yml \--input input1.jpg


# 报错:

AssertionError: get_event_storage() has to be called inside a 'with EventStorage(...)' context!

解决方案


roi_ heads.py中的

storage = get_ event_storage () 

改为

with EventStorage():
	storage = get_event_storage()

参考文献:
https://github.com/megvii-research/FSCE/issues/37

猜你喜欢

转载自blog.csdn.net/qq_39237205/article/details/130685332