Python中文
首页
教程
问答
标签
搜索
登录
注册
如何将路缘石中的参数设置为不可训练的?
回答此问题可获得
20
贡献值,回答如果被采纳可获得
50
分。
<p>我对凯拉斯很陌生,我正在做一个模型。我想冻结模型最后几层的权重,同时训练前几层。我试图将横向模型的可训练属性设置为False,但它似乎不起作用。下面是代码和模型摘要:</p> <pre><code>opt = optimizers.Adam(1e-3) domain_layers = self._build_domain_regressor() domain_layers.trainble = False feature_extrator = self._build_common() img_inputs = Input(shape=(160, 160, 3)) conv_out = feature_extrator(img_inputs) domain_label = domain_layers(conv_out) self.domain_regressor = Model(img_inputs, domain_label) self.domain_regressor.compile(optimizer = opt, loss='binary_crossentropy', metrics=['accuracy']) self.domain_regressor.summary() </code></pre> <p>模型摘要:<a href="https://i.stack.imgur.com/nWR8q.png" rel="nofollow noreferrer">model summary</a>。</p> <p>如您所见,<code>model_1</code>是可训练的。但根据规定,它是不可训练的。</p>
0 条评论
分类:
Python问答
请先
登录
后评论
默认排序
时间排序
1 个回答
匿名
1天前
擅长:python、mysql、java
<p>“trainble”一词有误(缺少“a”)。可悲的是,凯拉斯没有警告我,模型没有“可训练”的属性。这个问题可以结束了。</p>
请先
登录
后评论
针对此问题:
更多的回答
关注
89
关注
收藏
1
收藏,
216
浏览
网友 提问于 2天前
相关Python问题
无法使用Django restfram生成PDF
1 回答
无法使用Django Rest框架发送压缩的gzip数据
8 回答
无法使用Django rest框架进行身份验证(请求用户=匿名用户)
6 回答
无法使用Django、Python和JavaScrip触发onclick函数
6 回答
无法使用Django.views.generic.View保存表单
5 回答
无法使用Django(python 2.7,OS X 10.11.1)
7 回答
无法使用Django/mongoengine连接到MongoDB(身份验证失败)
10 回答
无法使用Django\u mssql\u后端迁移到外部hos
7 回答
无法使用Django&Python3.4连接到MySql
3 回答
无法使用Django+nginx上载媒体文件
9 回答
无法使用Django1.6导入名称模式
4 回答
无法使用Django1.7和mongodb登录管理站点
6 回答
无法使用Djangoadmin创建项目,进程使用了错误的路径,因为我事先安装了错误的Python
6 回答
无法使用Djangockedi验证CBV中的字段
5 回答
无法使用Djangocketditor上载图像(错误400)
2 回答
无法使用Djangocron进行函数调用
3 回答
无法使用Djangofiler djang上载文件
3 回答
无法使用Djangokronos
1 回答
无法使用Djangomssql provid
8 回答
无法使用Djangomssql连接到带有Django 1.11的MS SQL Server 2016
7 回答