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

the filepath provided must end in .weights.h5 #150

Open
schienstockd opened this issue Mar 22, 2024 · 8 comments
Open

the filepath provided must end in .weights.h5 #150

schienstockd opened this issue Mar 22, 2024 · 8 comments

Comments

@schienstockd
Copy link

Hello,

I'm using tensorflow 2.16.1 and get the following when trying to train a model with model.train

ValueError: When using `save_weights_only=True` in `ModelCheckpoint`, the filepath provided must end in `.weights.h5` (Keras weights format). Received: filepath=*/model_name/weights_best.h5

I had no issue with this before. Is this a new checkpoint in keras?

Thanks!

@schienstockd schienstockd changed the title ValueError: When using save_weights_only=True in ModelCheckpoint, the filepath provided must end in .weights.h5 (Keras weights format) the filepath provided must end in .weights.h5 Mar 22, 2024
@jdeschamps
Copy link
Member

jdeschamps commented Apr 6, 2024

Hi,

Sorry for the delay!

Yes it seems to be a problem of the newer TF... Can you downgrade to an earlier version?

We tested it last with TF2.13 and TF2.10. On CPU just now, it seems it works with TF2.15.

@jdeschamps
Copy link
Member

I have updated the installation instructions.

@romydhan
Copy link

romydhan commented Dec 5, 2024

Hi, I'm using TF2.10 and still getting this error....is there a fix?

@jdeschamps
Copy link
Member

That's surprising, I don't really remember but if I trust my past-self, this specific error should not appear with TF 2.10. Could you paste the exact error you are getting?

Please note that we do not intend to continue maintaining n2v and we will retire it soon. Instead, we are focusing on CAREamics, which allows you to run Noise2Void as well. If you encounter issues with CAREamics, we are more likely to fix them right away. 😃

That being said, I will try to issue a fix for this current issue, as it is simple enough to patch.

@romydhan
Copy link

romydhan commented Dec 5, 2024

Thanks for the quick response. FYI, I followed the instructions posted here to install everything but it's possible I did something wrong. This is the error I'm getting:
ValueError: When using save_weights_only=True in ModelCheckpoint, the filepath provided must end in .weights.h5 (Keras weights format). Received: filepath=C:\Users\CT-romy.napari\N2V\models\n2v_2D\weights_best.h5

Earlier on I see this, if this is helpful:
INFO: Creating model
10:32:36 : WARNING : Dummy-1 : From C:\ProgramData\anaconda3\envs\napari-n2v\lib\site-packages\keras\src\backend\tensorflow\core.py:222: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead.

2024-12-05 10:32:36.595188: I tensorflow/core/platform/cpu_feature_guard.cc:210] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F AVX512_VNNI AVX512_BF16 AVX512_FP16 AVX_VNNI AMX_TILE AMX_INT8 AMX_BF16 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.

I'm actually trying to just verify the TensorFlow version and having issues doing that. I'm new to it.

Thanks.

@jdeschamps
Copy link
Member

To be fair to you, the instructions are a bit of a mess!

Can you type in your console:

conda list | grep tensor

That should print the tensorflow version in your conda environment!

@romydhan
Copy link

romydhan commented Dec 5, 2024

I'm on windows, but when I type this

"conda list | findstr tensor"

it returns nothing....

[looking into CAREamics now, might be quicker to get that working than solve this issue]

@jdeschamps
Copy link
Member

Ah sorry! We usually advise people to use the "Git for windows" terminal under Windows, because then they can use Unix commands.

Then maybe just conda list and check out manually tensorflow in the list. You need to make sure that your conda environment is active.

[looking into CAREamics now, might be quicker to get that working than solve this issue]

Great, don't hesitate to open an issue there then!

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

4 participants
@jdeschamps @schienstockd @romydhan and others