I have installed the following environment on my laptop
pip install tensorflow-cpu==1.15.0
pip install keras==2.2.5
When I execute the following code:
create the base pre-trained model
base_model = DenseNet121(weights=‘…/nih/densenet.hdf5’, include_top=False)
I got an error:
D:\anaconda3\envs\tf1.15\lib\site-packages\keras\engine\saving.py in load_weights_from_hdf5_group(f, layers, reshape)
1143 “”"
1144 if ‘keras_version’ in f.attrs:
→ 1145 original_keras_version = f.attrs[‘keras_version’].decode(‘utf8’)
1146 else:
1147 original_keras_version = ‘1’
AttributeError: ‘str’ object has no attribute ‘decode’
Thank you very much for any suggestions
what are you doing ? trying to run codes of assignment locally?
If you are running the assignment locally, you have two options, either to replicate all the libraries in the lab with the specific version or you update the code to match the libraries version you have installed.
yes. Then I got that error
did you download all the files required to run the codes locally?
you probably missing the utils.py file which would contain all the attributable function added with the base model data and like as @lukmanaj mentioned you would still require more modules and version match with the codes you working on. this you will have to do yourself based on your system and python settings.
I also remember downloading tf and keras isn’t enough to download based model from the codes you are working and the loaded weights are of particular datatype which was used to downloaded in the course environment.
so do you have model downloaded in your system for its weight to be downloaded?