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

Interpret optimizeter issue #529

Open
tayyabawan786 opened this issue May 2, 2024 · 3 comments
Open

Interpret optimizeter issue #529

tayyabawan786 opened this issue May 2, 2024 · 3 comments

Comments

@tayyabawan786
Copy link

i face error ValueError: Could not interpret optimizer identifier: <keras.src.optimizers.legacy.adam.Adam object at 0x78ac23a95ab0>

i have updated transformers also before 1 month it dont have any error now it show me this error when i run this code could you please guide me on this
MODEL_NAME = 'google-bert/bert-base-uncased'

t = text.Transformer(MODEL_NAME, maxlen=400, classes=np.array([0,1]))
trn = t.preprocess_train(np.array(X_train),np.array(y_train))
val = t.preprocess_test(np.array(X_val), np.array(y_val))
model = t.get_classifier()
learner = ktrain.get_learner(model, train_data=trn, val_data=val, batch_size=12)

@amaiya
Copy link
Owner

amaiya commented May 2, 2024

What versions of ktrain and TensorFlow are you using?

@tayyabawan786
Copy link
Author

i have solved it by using this code
!pip install tf-keras
import os
os.environ['TF_USE_LEGACY_KERAS'] = "True"

@tahlilsiam
Copy link

Can you tell me what's the reason of this optimizer interpretation issue?

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

3 participants