请使用机器学习帮助解决有关分类的代码 模型。它抛出以下错误。该代码的主要本质是训练一个 使用imdb数据进行建模以在正面评论和 负面评论。
<div class='row'>
<div class='sideBar'>
</div>
<div class='mainArea'>
<ng-template #content let-modal>
<div class="modal-header">
<h4 class="modal-title" id="modal-basic-title">Profile update</h4>
<button type="button" class="close" aria-label="Close" (click)="modal.dismiss('Cross click')">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form>
<div class="form-group">
<label for="dateOfBirth">Date of birth</label>
<div class="input-group">
<input id="dateOfBirth" class="form-control" placeholder="yyyy-mm-dd" name="dp" ngbDatepicker #dp="ngbDatepicker">
<div class="input-group-append">
<button class="btn btn-outline-secondary calendar" (click)="dp.toggle()" type="button"></button>
</div>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-outline-dark" (click)="modal.close('Save click')">Save</button>
</div>
</ng-template>
<button class="btn btn-lg btn-outline-primary" (click)="open(content)">Launch demo modal</button>
<hr>
<pre>{{closeResult}}</pre>
</div>
</div>
我看过关键代码,却无法发现问题的根源。
File "/Users/darlingtonemeagi/Downloads/untitled14.py", line 49, in <module>
model = models.Sequential()
File "/anaconda3/lib/python3.5/site-packages/keras/engine/sequential.py", line 87, in __init__
super(Sequential, self).__init__(name=name)
File "/anaconda3/lib/python3.5/site-packages/keras/legacy/interfaces.py", line 91, in wrapper
return func(*args, **kwargs)
File "/anaconda3/lib/python3.5/site-packages/keras/engine/network.py", line 96, in __init__
self._init_subclassed_network(**kwargs)
File "/anaconda3/lib/python3.5/site-packages/keras/engine/network.py", line 300, in _init_subclassed_network
self._base_init(name=name)
File "/anaconda3/lib/python3.5/site-packages/keras/engine/network.py", line 110, in _base_init
self.name = name
File "/anaconda3/lib/python3.5/site-packages/keras/engine/network.py", line 322, in __setattr__
super(Network, self).__setattr__(name, value)
TypeError: super(type, obj): obj must be an instance or subtype of type"
预期输出是训练损失和验证损失的图形表示。