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

AttributeError: 'ModelCheckpoint' object has no attribute '_implements_train_batch_hooks' in MoViNet Streaming Model Training #69448

Closed
yuvch98 opened this issue Jun 9, 2024 · 4 comments
Assignees
Labels
comp:model Model related issues stale This label marks the issue/pr stale - to be closed automatically if no activity stat:awaiting response Status - Awaiting response from author TF 2.16 type:bug Bug

Comments

@yuvch98
Copy link

yuvch98 commented Jun 9, 2024

Issue type

Bug

Have you reproduced the bug with TensorFlow Nightly?

No

Source

source

TensorFlow version

tf 2.16.1

Custom code

No

OS platform and distribution

Google Colab

Mobile device

No response

Python version

3.10

Bazel version

No response

GCC/compiler version

No response

CUDA/cuDNN version

No response

GPU model and memory

No response

Current behavior?

I encountered an AttributeError while trying to fit the model using the MoViNet Streaming Model Training and Inference notebook provided in the TensorFlow Model Garden repository. The specific error message is as follows:
image

in addition, there is a minor adjustment needed to be done in this code:
image

Standalone code to reproduce the issue

The issue can be reproduced using the notebook from the official TensorFlow Models GitHub repository:

https://github.com/tensorflow/models/blob/f9fdc4faef47af76351204b6d8df576f0e79baab/official/projects/movinet/movinet_streaming_model_training_and_inference.ipynb

Relevant log output

AttributeError                            Traceback (most recent call last)
<ipython-input-18-49dc73e1e0f6> in <cell line: 1>()
----> 1 results = model.fit(train_ds,
      2                     validation_data=val_ds,
      3                     epochs=2,
      4                     validation_freq=1,
      5                     verbose=1,

1 frames
/usr/local/lib/python3.10/dist-packages/tf_keras/src/callbacks.py in <genexpr>(.0)
    243             getattr(cb, "_supports_tf_logs", False)
    244             for cb in self.callbacks
--> 245             if cb._implements_train_batch_hooks()
    246             or cb._implements_test_batch_hooks()
    247             or cb._implements_predict_batch_hooks()

AttributeError: 'ModelCheckpoint' object has no attribute '_implements_train_batch_hooks'
@google-ml-butler google-ml-butler bot added the type:bug Bug label Jun 9, 2024
@sushreebarsa sushreebarsa added comp:apis Highlevel API related issues TF 2.16 labels Jun 10, 2024
@sushreebarsa
Copy link
Contributor

@yuvch98 Could you try creating a new virtual environment to avoid conflicts with existing project dependencies and if you still face the issue then please post this issue on models repository for further assistance.
Thank you!

@sushreebarsa sushreebarsa added stat:awaiting response Status - Awaiting response from author comp:model Model related issues and removed comp:apis Highlevel API related issues labels Jun 10, 2024
Copy link

This issue is stale because it has been open for 7 days with no activity. It will be closed if no further activity occurs. Thank you.

@github-actions github-actions bot added the stale This label marks the issue/pr stale - to be closed automatically if no activity label Jun 18, 2024
Copy link

This issue was closed because it has been inactive for 7 days since being marked as stale. Please reopen if you'd like to work on this further.

Copy link

Are you satisfied with the resolution of your issue?
Yes
No

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:model Model related issues stale This label marks the issue/pr stale - to be closed automatically if no activity stat:awaiting response Status - Awaiting response from author TF 2.16 type:bug Bug
Projects
None yet
Development

No branches or pull requests

2 participants