提交 3b9975eb authored 作者: Piotr Frankowski's avatar Piotr Frankowski

fix according to comments

上级 abc28761
...@@ -351,6 +351,7 @@ def print_compiledir_content(): ...@@ -351,6 +351,7 @@ def print_compiledir_content():
for dir in os.listdir(compiledir): for dir in os.listdir(compiledir):
filename = os.path.join(compiledir, dir, "key.pkl") filename = os.path.join(compiledir, dir, "key.pkl")
with open(filename, 'rb') as file: with open(filename, 'rb') as file:
try:
keydata = pickle.load(file) keydata = pickle.load(file)
ops = list(set([x for x in flatten(keydata.keys) ops = list(set([x for x in flatten(keydata.keys)
if isinstance(x, theano.gof.Op)])) if isinstance(x, theano.gof.Op)]))
...@@ -370,6 +371,8 @@ def print_compiledir_content(): ...@@ -370,6 +371,8 @@ def print_compiledir_content():
nb_keys.setdefault(len(keydata.keys), 0) nb_keys.setdefault(len(keydata.keys), 0)
nb_keys[len(keydata.keys)] += 1 nb_keys[len(keydata.keys)] += 1
except IOError:
pass
print("List of %d compiled individual ops in this theano cache %s:" % ( print("List of %d compiled individual ops in this theano cache %s:" % (
len(table), compiledir)) len(table), compiledir))
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论