Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Colab notebook does not work #43

Open
ma7555 opened this issue Dec 15, 2021 · 1 comment
Open

Colab notebook does not work #43

ma7555 opened this issue Dec 15, 2021 · 1 comment

Comments

@ma7555
Copy link

ma7555 commented Dec 15, 2021

Traceback (most recent call last):
  File "test.py", line 77, in <module>
    app.run(main)
  File "/usr/local/lib/python3.7/dist-packages/absl/app.py", line 303, in run
    _run_main(main, args)
  File "/usr/local/lib/python3.7/dist-packages/absl/app.py", line 251, in _run_main
    sys.exit(main(argv))
  File "test.py", line 31, in main
    training=False)
  File "/content/arcface-tf2/modules/models.py", line 82, in ArcFaceModel
    x = Backbone(backbone_type=backbone_type, use_pretrain=use_pretrain)(x)
  File "/content/arcface-tf2/modules/models.py", line 32, in backbone
    weights=weights)(x_in)
  File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/keras/applications/__init__.py", line 46, in wrapper
    return base_fun(*args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/keras/applications/resnet.py", line 33, in ResNet50
    return resnet.ResNet50(*args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/keras_applications/resnet_common.py", line 435, in ResNet50
    **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/keras_applications/resnet_common.py", line 411, in ResNet
    model.load_weights(weights_path)
  File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/keras/engine/training.py", line 234, in load_weights
    return super(Model, self).load_weights(filepath, by_name, skip_mismatch)
  File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/keras/engine/network.py", line 1222, in load_weights
    hdf5_format.load_weights_from_hdf5_group(f, self.layers)
  File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/keras/saving/hdf5_format.py", line 651, in load_weights_from_hdf5_group
    original_keras_version = f.attrs['keras_version'].decode('utf8')
AttributeError: 'str' object has no attribute 'decode'
@kjaleph
Copy link

kjaleph commented Feb 13, 2022

@ma7555 Run below:
pip install 'h5py<3.0.0'
The error is happening due to newer version of h5py.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants