'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:
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:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Hi @shaksham-4176, I ran into this issue as well.
As with many strange Tensorflow errors, this was caused by mixing
tensorflow.keras
withkeras
.It appears that talos is using
keras
, so replacing all occurences offrom tensorflow.keras import ...
withfrom keras import ...
in your code will probably fix your issue (assuming you have standalone Keras installed).This has now been fixed in the underlying dependency. Closing here.