Skip to content
代码片段 群组 项目
提交 962939d3 编辑于 作者: Toshihiro Nakae's avatar Toshihiro Nakae
浏览文件

add error handlings

上级 cebf5384
分支
无相关合并请求
......@@ -156,10 +156,16 @@ class DAGMM:
energies : array-like, shape (n_samples)
Calculated sample energies.
"""
if self.sess is None:
raise Exception("Trained model does not exist.")
energies = self.sess.run(self.energy, feed_dict={self.input:x})
return energies
def save(self, fdir):
if self.sess is None:
raise Exception("Trained model does not exist.")
if not exists(fdir):
makedirs(fdir)
......
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册