From 41366753d11a7fecaf02ffda57c1cd5b02a225f4 Mon Sep 17 00:00:00 2001 From: DEKHTIARJonathan Date: Tue, 15 May 2018 11:54:39 +0200 Subject: [PATCH] Issue 498 Fix --- CHANGELOG.md | 1 + tensorlayer/files.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a4c21472e..0031958da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -81,6 +81,7 @@ To release a new version, please update the changelog as followed: ### Removed ### Fixed +- Issue #498 - Deprecation Warning Fix in `tl.files` with truth value of an empty array is ambiguous (by @DEKHTIARJonathan in #575) ### Security diff --git a/tensorlayer/files.py b/tensorlayer/files.py index cd505e269..27bce1645 100644 --- a/tensorlayer/files.py +++ b/tensorlayer/files.py @@ -1447,9 +1447,9 @@ def save_joints(): joint_pos[int(_j_id)] = [float(_x), float(_y)] # joint_pos = fix_wrong_joints(joint_pos) - # visiblity list + # visibility list if 'is_visible' in str(annopoint.dtype): - vis = [v[0] if v else [0] for v in annopoint['is_visible'][0]] + vis = [v[0] if v.size > 0 else [0] for v in annopoint['is_visible'][0]] vis = dict([(k, int(v[0])) if len(v) > 0 else v for k, v in zip(j_id, vis)]) else: vis = None