为什么Pytorch Mask RCNN报告运行时错误?

时间:2019-05-11 14:51:05

标签: python pytorch

当我从https://github.com/facebookresearch/maskrcnn-benchmark运行Mask RCNN时,出现此错误:

raise RuntimeError("Invoked 'with amp.scale_loss`, but internal Amp state has not been initialized.  "
RuntimeError: Invoked 'with amp.scale_loss`, but internal Amp state has not been initialized.  model, optimizer = amp.initialize(model, optimizer, opt_level=...) must be called before `with amp.scale_loss`.

当我添加

model, optimizer = amp.initialize(model, optimizer, opt_level="O0")

amp.scale_loss之前,出现此错误:

raise RuntimeError("A given optimizer should only be passed through amp.initialize once.")
RuntimeError: A given optimizer should only be passed through amp.initialize once.

我该如何解决这个问题?

0 个答案:

没有答案