question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'TrainingLog' object has no attribute '_implements_train_batch_hooks'

See original GitHub issue

#66 ## 1) Confirm the below

  • Python version - 3.6.9

  • Tensorflow version - 2.2.0

  • I’ve tested my Keras model and it works as a stand-alone

2) Include the output of:

talos.__version__ - 1.0.0

3) Explain what actually happened

I am trying to perform hyperparameter tuning using the TextCNN model and the IMDB Dataset on Colab. I followed the steps mentioned in one of the example notebooks on how to set up the required parameter space and run talos using the Scan() function.

The problem is when I try to execute the following statement:

t = talos.Scan(x=X_train, y=y_train, model=build_model, params=p, experiment_name='sentiment_analysis', fraction_limit = 0.1)

I am getting the following error message:

AttributeError: 'TrainingLog' object has no attribute '_implements_train_batch_hooks'

5) Provide a code-complete reference

Input model:

image

Parameter dictionary:

# then we can go ahead and set the parameter space p = {'batch_size': [32, 64], 'epochs': [50, 100], 'kernel_initializer': ['uniform', 'normal', 'glorot_uniform', 'he_normal'], 'optimizer': ['SGD', 'RMSprop', 'Adagrad', 'Adadelta', 'Adam', 'Adamax', 'Nadam'], 'activation':['relu', 'elu'], }

Please help me out with this. Am I doing something wrong? Also, how can I make use of the GPU/TPU facility provided in Colab. When I try to run the code using talos, it is using CPU and not GPU.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
faberocommented, Aug 4, 2020

Hi @shaksham-4176, I ran into this issue as well.

As with many strange Tensorflow errors, this was caused by mixing tensorflow.keras with keras.

It appears that talos is using keras, so replacing all occurences of from tensorflow.keras import ... with from keras import ... in your code will probably fix your issue (assuming you have standalone Keras installed).

0reactions
mikkokotilacommented, Apr 16, 2022

This has now been fixed in the underlying dependency. Closing here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

'ReduceLROnPlateau' object has no attribute ... - Stack Overflow
My code is working without the learning rate scheduler and this is the error I get whenever I try to callback this particular...
Read more >
'DescribeKey' object has no attribute 'log' · Issue #6198 - GitHub
Describe the bug Using a KMS type resource, where access to the KMS key is denied, a log call is made that seems...
Read more >
'NoneType' object has no attribute '_log' `when trying to run ...
I was calling my test function outside of wandb(only used wandb for training)and wandb must have call .finish so, it must have set...
Read more >
AttributeError: 'MultivariateSample' object has no attribute 'train'
While running the python code that is available in the linkclient-libraries-multivariate , i got the below error in "Run the Application" area.
Read more >
NetApp XCP sync failed with error "compare batches
NetApp XCP over NFS sync failed with below error in xcp.log: ERROR: compare batches: 'NoneType' object has no attribute '__getitem__'".
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found