You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug(问题描述) model.save_weights causes TypeError: a bytes-like object is required, not 'str'.
Related issue: h5py==3.0.0 causes issues with keras model loads in tensorflow 2.1.0 (tensorflow/tensorflow#44467).
Suggested sulotion:
pin to h5py==2.10.0 this for all TF >= 2.1
Traceback (most recent call last):
File "/Users/zsx/Code/DeepCTR/examples/run_classification_criteo.py", line 53, in <module>
model.save_weights('deepfm_weights.h5')
File "/Users/zsx/anaconda3/envs/tf2.3/lib/python3.6/site-packages/tensorflow_core/python/keras/engine/network.py", line 1107, in save_weights
hdf5_format.save_weights_to_hdf5_group(f, self.layers)
File "/Users/zsx/anaconda3/envs/tf2.3/lib/python3.6/site-packages/tensorflow_core/python/keras/saving/hdf5_format.py", line 631, in save_weights_to_hdf5_group
param_dset = g.create_dataset(name, val.shape, dtype=val.dtype)
File "/Users/zsx/anaconda3/envs/tf2.3/lib/python3.6/site-packages/h5py/_hl/group.py", line 143, in create_dataset
if '/' in name:
TypeError: a bytes-like object is required, not 'str'
To Reproduce(复现步骤)
There are two ways to reproduce the behavior:
add model.save_weights('deepfm_weights.h5') in the end of run_classification_criteo.py
or
run the DeepFM_test.py
Operating environment(运行环境):
python version 3.6.5
tensorflow version 2.1.0
deepctr version 0.8.2
h5py version 3.0.0
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
zanshuxun
changed the title
model.save_weights causes TypeError: a bytes-like object is required, not 'str'
h5py==3.0.0 causes model save issues in tf 2.1.0
Aug 5, 2022
Describe the bug(问题描述)
model.save_weights
causesTypeError: a bytes-like object is required, not 'str'
.Related issue: h5py==3.0.0 causes issues with keras model loads in tensorflow 2.1.0 (tensorflow/tensorflow#44467).
Suggested sulotion:
To Reproduce(复现步骤)
There are two ways to reproduce the behavior:
model.save_weights('deepfm_weights.h5')
in the end ofrun_classification_criteo.py
or
DeepFM_test.py
Operating environment(运行环境):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: