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
WARNING:tensorflow:From /home/ec2-user/anaconda3/envs/python3/lib/python3.6/site-packages/tensorflow_core/python/ops/resource_variable_ops.py:1630: calling BaseResourceVariable.__init__ (from tensorflow.python.ops.resource_variable_ops) with constraint is deprecated and will be removed in a future version.
Instructions for updating:
If using Keras pass *_constraint arguments to layers.
Downloading data from https://github.com/keras-team/keras-applications/releases/download/resnet/resnet50_weights_tf_dim_ordering_tf_kernels.h5
102973440/102967424 [==============================] - 5s 0us/step
Traceback (most recent call last):
File "aws-neuron-sdk/src/examples/tensorflow/keras_resnet50/gen_resnet50_keras.py", line 35, in <module>
model = ResNet50(weights='imagenet')
File "/home/ec2-user/anaconda3/envs/python3/lib/python3.6/site-packages/tensorflow_core/python/keras/applications/__init__.py", line 49, in wrapper
return base_fun(*args, **kwargs)
File "/home/ec2-user/anaconda3/envs/python3/lib/python3.6/site-packages/tensorflow_core/python/keras/applications/resnet.py", line 33, in ResNet50
return resnet.ResNet50(*args, **kwargs)
File "/home/ec2-user/anaconda3/envs/python3/lib/python3.6/site-packages/keras_applications/resnet_common.py", line 435, in ResNet50
**kwargs)
File "/home/ec2-user/anaconda3/envs/python3/lib/python3.6/site-packages/keras_applications/resnet_common.py", line 411, in ResNet
model.load_weights(weights_path)
File "/home/ec2-user/anaconda3/envs/python3/lib/python3.6/site-packages/tensorflow_core/python/keras/engine/training.py", line 182, in load_weights
return super(Model, self).load_weights(filepath, by_name)
File "/home/ec2-user/anaconda3/envs/python3/lib/python3.6/site-packages/tensorflow_core/python/keras/engine/network.py", line 1373, in load_weights
saving.load_weights_from_hdf5_group(f, self.layers)
File "/home/ec2-user/anaconda3/envs/python3/lib/python3.6/site-packages/tensorflow_core/python/keras/saving/hdf5_format.py", line 645, in load_weights_from_hdf5_group
original_keras_version = f.attrs['keras_version'].decode('utf8')
AttributeError: 'str' object has no attribute 'decode'
The issue appears to be related to the h5py library when using the following version:
import sys
!{sys.executable} -m pip show h5py
Output:
Name: h5py
Version: 3.1.0
Summary: Read and write HDF5 files from Python
Home-page: http://www.h5py.org
Author: Andrew Collette
Author-email: andrew.collette@gmail.com
License: BSD
Location: /home/ec2-user/anaconda3/envs/python3/lib/python3.6/site-packages
Requires: cached-property, numpy
Required-by: Keras-Applications
If I downgrade to 2.9.0, things seem to work fine.
When attempting to run the Keras Resnet50 tutorial, I received the following error:
Output:
The issue appears to be related to the h5py library when using the following version:
Output:
If I downgrade to 2.9.0, things seem to work fine.
I also came across this issue that may be related - tensorflow/tensorflow#44467
The text was updated successfully, but these errors were encountered: