Skip to content

Commit 6bacee4

Browse files
authored
fix log level for load_and_assign_npz and load_and_assign_npz_dict (#812)
* fix log level for load_and_assign_npz_dict * update changelog
1 parent 1f0517e commit 6bacee4

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ To release a new version, please update the changelog as followed:
9494
- Setup:
9595
- Creation of installation flaggs `all_dev`, `all_cpu_dev`, and `all_gpu_dev` (PR #739)
9696
- Examples:
97-
- change folder struction (PR #802)
97+
- change folder struction (PR #802)
9898
- `tutorial_models_vgg19` has been introduced to show how to use `tl.model.vgg19` (PR #698).
9999
- fix bug of `tutorial_bipedalwalker_a3c_continuous_action.py` (PR #734, Issue #732)
100100
- `tutorial_models_vgg16` and `tutorial_models_vgg19` has been changed the input scale from [0,255] to [0,1](PR #710)
@@ -129,6 +129,7 @@ To release a new version, please update the changelog as followed:
129129
- Dockerfiles import error fixed - issue #733 (PR #747)
130130
- Fix a typo in `absolute_difference_error` in file: `tensorlayer/cost.py` - Issue #753 (PR #759)
131131
- Fix the bug of scaling the learning rate of trainer (PR #776)
132+
- log error instead of info when npz file not found. (PR #812)
132133

133134
### Security
134135

tensorlayer/files/utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1705,8 +1705,8 @@ def load_and_assign_npz(sess=None, name=None, network=None):
17051705
if sess is None:
17061706
raise ValueError("session is None.")
17071707
if not os.path.exists(name):
1708-
logging.info("[!] Load {} failed!".format(name))
1709-
return False
1708+
logging.error("file {} doesn't exist.".format(name))
1709+
return
17101710
else:
17111711
params = load_npz(name=name)
17121712
assign_params(sess, params, network)
@@ -1760,8 +1760,8 @@ def load_and_assign_npz_dict(name='model.npz', sess=None):
17601760
raise ValueError("session is None.")
17611761

17621762
if not os.path.exists(name):
1763-
logging.info("[!] Load {} failed!".format(name))
1764-
return False
1763+
logging.error("file {} doesn't exist.".format(name))
1764+
return
17651765

17661766
params = np.load(name)
17671767
if len(params.keys()) != len(set(params.keys())):

0 commit comments

Comments
 (0)