问题描述
报错提示类中不能有super的方法。
问题:
RuntimeError: __class__ not set defining 'AttentionModelFixed' as <class 'attention_model.AttentionModelFixed'>. Was __classcell__ propagated to type.__new__?
报错代码:
class AttentionModelFixed(NamedTuple):
def __getitem__(self, key):
if xxxx:
return AttentionModelFixed(xxx) )
return super(AttentionModelFixed, self).__getitem__(key)
解决方案:
启动正确的虚拟环境。