You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Standalone code to reproduce the issue or tutorial link
import os
os.environ["KERAS_BACKEND"] = "tensorflow"
import pathlib
import random
import string
import re
import numpy as np
import tensorflow.data as tf_data
import tensorflow.strings as tf_strings
import keras
from keras import layers
from keras import ops
from keras.layers import TextVectorization
Relevant log output
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
[<ipython-input-13-5bf91004141f>](https://localhost:8080/#) in <cell line: 25>()
23 import keras
24 from keras import layers
---> 25 from keras import ops
26 from keras.layers import TextVectorization
ImportError: cannot import name 'ops' from 'keras' (/usr/local/lib/python3.10/dist-packages/keras/__init__.py)
---------------------------------------------------------------------------
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.
To view examples of installing some common dependencies, click the
"Open Examples" button below.
---------------------------------------------------------------------------
The text was updated successfully, but these errors were encountered:
Thank you for your suggestion. I run this script in my local environment successfully based keras3. What'more, I also run this tutorial in Colab successfuuly by add a code cell !pip install keras==3.0.0
Issue Type
Bug
Source
source
Keras Version
Keras 2.14.0
Custom Code
Yes
OS Platform and Distribution
Linux Ubuntu 22.04.3 LTS
Python version
3.10
GPU model and memory
NVIDIA T4
Current Behavior?
When run the example neural_machine_translation_with_transformer on Google Colab directly , I got error.
![image](https://private-user-images.githubusercontent.com/51162830/287139056-2dae8247-1457-41d7-92d3-75a01888cead.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyMzk1MDMsIm5iZiI6MTczOTIzOTIwMywicGF0aCI6Ii81MTE2MjgzMC8yODcxMzkwNTYtMmRhZTgyNDctMTQ1Ny00MWQ3LTkyZDMtNzVhMDE4ODhjZWFkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDAyMDAwM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTkzMjI2OGEwYThiZmY4MzQwMmQyNjAyMmZiZTEwY2U1NWM1MjVkYTIwYzI5ZTAxMTI1MmY3MWQxZjU1YzRiMzEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.o5spI-j4NdkIFKQVhM_jME3p50cdQIZEtHqFWV82dds)
Standalone code to reproduce the issue or tutorial link
Relevant log output
The text was updated successfully, but these errors were encountered: