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

How to apply checkpoints which trained on Keras2? #12

Open
forestbat opened this issue Mar 15, 2024 · 0 comments
Open

How to apply checkpoints which trained on Keras2? #12

forestbat opened this issue Mar 15, 2024 · 0 comments

Comments

@forestbat
Copy link

I want to use your pretrained checkpoint model on my project, however it crashed under Keras3:

model = deepwatermap.model()
model.load_weights(checkpoint_path)

ValueError: File format not supported: filepath=C:\Users\Administrator\deepwatermap-checkpoints. Keras 3 only supports V3 `.keras` and `.weights.h5` files, or legacy V1/V2 `.h5` files.

And when use another method to read your ckpt file, it crashed like that:

import  from tensorflow.python.training.py_checkpoint_reader import NewCheckpointReader
reader = NewCheckpointReader(r'C:\Users\Administrator\deepwatermap-checkpoints')

; Input/output error
Traceback (most recent call last):
  File "C:\Users\Administrator\AppData\Roaming\JetBrains\IntelliJIdea2023.3\plugins\python\helpers\pydev\pydevconsole.py", line 364, in runcode
    coro = func()
           ^^^^^^
  File "<input>", line 1, in <module>
  File "C:\Users\Administrator\IdeaProjects\deepwatermap\venv\Lib\site-packages\tensorflow\python\training\py_checkpoint_reader.py", line 92, in NewCheckpointReader
    return CheckpointReader(compat.as_bytes(filepattern))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xbe in position 177: invalid start byte

So do you have time to retrain a model or tell me how to solve this problem?

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

1 participant