exceptions must be old-style classes or derived from BaseException, not NoneT

在执行程序时

# load vgg16
        if self.pretrained_model is not None and not restore:
            try:
                print(('Loading pretrained model '
                   'weights from {:s}').format(self.pretrained_model))
                self.net.load(self.pretrained_model, sess, True)
            except NameError:
                raise 'Check your pretrained model {:s}'.format(self.pretrained_model)

报错:

原因:

This is because you are using raise without providing an exception type or instance.

地址:

https://stackoverflow.com/questions/27438986/exceptions-must-be-old-style-classes-or-derived-from-baseexception-not-nonetype


猜你喜欢

转载自blog.csdn.net/m0_37407756/article/details/80181727